From 7c8e3f9dcfee3826dcf04aa3cb99453ba01331d7 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Tue, 1 Apr 2025 13:36:30 +0800 Subject: LMTP configuration update --- lmtp_server.go | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lmtp_server.go') diff --git a/lmtp_server.go b/lmtp_server.go index 8e574e4..041194e 100644 --- a/lmtp_server.go +++ b/lmtp_server.go @@ -11,6 +11,7 @@ import ( "log/slog" "net" "strings" + "time" "github.com/emersion/go-message" "github.com/emersion/go-smtp" @@ -53,7 +54,14 @@ func (*lmtpHandler) NewSession(_ *smtp.Conn) (smtp.Session, error) { } func serveLMTP(listener net.Listener) error { + // TODO: Manually construct smtp.Server smtpServer := smtp.NewServer(&lmtpHandler{}) + smtpServer.LMTP = true + smtpServer.Domain = config.LMTP.Domain + smtpServer.Addr = config.LMTP.Socket + smtpServer.WriteTimeout = time.Duration(config.LMTP.WriteTimeout) * time.Second + smtpServer.ReadTimeout = time.Duration(config.LMTP.ReadTimeout) * time.Second + smtpServer.EnableSMTPUTF8 = true return smtpServer.Serve(listener) } -- cgit v1.2.3