a simple smtp server library for writing email servers like a boss.
go get github.com/stouch/go-smtpsrv
package main
import (
"fmt"
"github.com/stouch/go-smtpsrv/v3"
)
func main() {
handler := func(c smtpsrv.Context) error {
// ...
return nil
}
cfg := smtpsrv.ServerConfig{
BannerDomain: "mail.my.server",
ListenAddress: ":25025",
MaxMessageBytes: 5 * 1024,
Handler: handler,
}
fmt.Println(smtpsrv.ListenAndServe(cfg))
}