https://github.com/tuck1s/go-smtpproxy
Go package for transparent SMTP proxying, based on https://github.com/emersion/go-smtp
https://github.com/tuck1s/go-smtpproxy
golang proxy smtp smtp-client smtp-server
Last synced: 6 months ago
JSON representation
Go package for transparent SMTP proxying, based on https://github.com/emersion/go-smtp
- Host: GitHub
- URL: https://github.com/tuck1s/go-smtpproxy
- Owner: tuck1s
- License: apache-2.0
- Created: 2019-08-27T10:42:23.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-03-20T20:42:55.000Z (over 6 years ago)
- Last Synced: 2024-06-20T15:03:19.198Z (about 2 years ago)
- Topics: golang, proxy, smtp, smtp-client, smtp-server
- Language: Go
- Homepage:
- Size: 2.92 MB
- Stars: 13
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-smtpproxy
[](https://travis-ci.org/tuck1s/go-smtpproxy)
[](https://coveralls.io/github/tuck1s/go-smtpproxy?branch=master)
Go package, based heavily on [emersion's go-gmtp](https://github.com/emersion/go-smtp), with increased transparency of response codes and no sasl dependency.
The purpose of this is to provide functions that act as a server to receive SMTP messages from your downstream client. These SMTP messages are relayed through to
an upstream server.
The command / response exchanges are passed on transparently.
STARTTLS can be offered to the downstream client if you configure a valid certificate/key pair.
STARTTLS can be requested from the upstream server.
[Line splitting](linesplitter.go) functions are included for base64 encoded email handling by your app.
Get this project with `go get github.com/tuck1s/go-smtpproxy`.
`cmd/proxy` contains an example command-line app using this library:
```bash
cd cmd/proxy
go build
./proxy -h
SMTP proxy that accepts incoming messages from your downstream client, and relays on to an upstream server.
Usage of ./proxy:
-certfile string
Certificate file for this server
-downstream_debug string
File to write downstream server SMTP conversation for debugging
-in_hostport string
Port number to serve incoming SMTP requests (default "localhost:587")
-insecure_skip_verify
Skip check of peer cert on upstream side
-logfile string
File written with message logs (also to stdout)
-out_hostport string
host:port for onward routing of SMTP requests (default "smtp.sparkpostmail.com:587")
-privkeyfile string
Private key file for this server
-verbose
print out lots of messages
```