fork of github.com/chrj/smtpd
* Implement graceful shutdown This borrows heavily from the implementation of net/http Server.Shutdown(). Closes #10 * Add Server.Address() function to return listener address of a Server This is useful for logging, etc. * Refactor out Server.Wait() and add 'wait' param to Shutdown() This allows a consumer which runs multiple Servers (decke/smtprelay) to first shut down all servers (passing wait=false) so no new connections are accepted, and then wait for outstanding client connections to finish. |
||
|---|---|---|
| .github/workflows | ||
| examples/dkim-proxy | ||
| address.go | ||
| envelope.go | ||
| example_test.go | ||
| go.mod | ||
| go.sum | ||
| LICENSE | ||
| protocol.go | ||
| protocol_test.go | ||
| README.md | ||
| smtpd.go | ||
| smtpd_test.go | ||
| wrap.go | ||
| wrap_test.go | ||
Go smtpd

Package smtpd implements an SMTP server in golang.
Features
- STARTTLS (using
crypto/tls) - Authentication (PLAIN/LOGIN, only after STARTTLS)
- XCLIENT and PROXY protocol (for running behind a proxy)
- Connection, HELO, sender and recipient checks for rejecting e-mails using callbacks
- Configurable limits for: connection count, message size and recipient count
- Hands incoming e-mail off to a configured callback function
Version numbers
The package is tagged with semantic version numbers, making it suitable for use in a Go Module.
Feedback
If you end up using this package or have any feedback, I'd very much like to hear about it. You can reach me by email.