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