aboutsummaryrefslogtreecommitdiff
path: root/lmtp_server.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-04-05 21:47:44 +0800
committerRunxi Yu <me@runxiyu.org>2025-04-05 21:47:44 +0800
commitefa6f33b4c67f64a4a8d8cd723b9bbc9494fc735 (patch)
treec4075c78bc4126d764f91ec68931c34281913dcc /lmtp_server.go
parentAdd missing copyright headers (diff)
downloadforge-efa6f33b4c67f64a4a8d8cd723b9bbc9494fc735.tar.gz
forge-efa6f33b4c67f64a4a8d8cd723b9bbc9494fc735.tar.zst
forge-efa6f33b4c67f64a4a8d8cd723b9bbc9494fc735.zip
Unexport fields in Serverv0.1.24
Diffstat (limited to 'lmtp_server.go')
-rw-r--r--lmtp_server.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/lmtp_server.go b/lmtp_server.go
index ae912c5..3abfdb6 100644
--- a/lmtp_server.go
+++ b/lmtp_server.go
@@ -66,10 +66,10 @@ func (*lmtpHandler) NewSession(_ *smtp.Conn) (smtp.Session, error) {
func (s *Server) serveLMTP(listener net.Listener) error {
smtpServer := smtp.NewServer(&lmtpHandler{})
smtpServer.LMTP = true
- smtpServer.Domain = s.Config.LMTP.Domain
- smtpServer.Addr = s.Config.LMTP.Socket
- smtpServer.WriteTimeout = time.Duration(s.Config.LMTP.WriteTimeout) * time.Second
- smtpServer.ReadTimeout = time.Duration(s.Config.LMTP.ReadTimeout) * time.Second
+ smtpServer.Domain = s.config.LMTP.Domain
+ smtpServer.Addr = s.config.LMTP.Socket
+ smtpServer.WriteTimeout = time.Duration(s.config.LMTP.WriteTimeout) * time.Second
+ smtpServer.ReadTimeout = time.Duration(s.config.LMTP.ReadTimeout) * time.Second
smtpServer.EnableSMTPUTF8 = true
return smtpServer.Serve(listener)
}
@@ -85,9 +85,9 @@ func (session *lmtpSession) Data(r io.Reader) error {
n int64
)
- n, err = io.CopyN(&buf, r, session.s.Config.LMTP.MaxSize)
+ n, err = io.CopyN(&buf, r, session.s.config.LMTP.MaxSize)
switch {
- case n == session.s.Config.LMTP.MaxSize:
+ case n == session.s.config.LMTP.MaxSize:
err = errors.New("Message too big.")
// drain whatever is left in the pipe
_, _ = io.Copy(io.Discard, r)
@@ -133,10 +133,10 @@ func (session *lmtpSession) Data(r io.Reader) error {
_ = from
for _, to := range to {
- if !strings.HasSuffix(to, "@"+session.s.Config.LMTP.Domain) {
+ if !strings.HasSuffix(to, "@"+session.s.config.LMTP.Domain) {
continue
}
- localPart := to[:len(to)-len("@"+session.s.Config.LMTP.Domain)]
+ localPart := to[:len(to)-len("@"+session.s.config.LMTP.Domain)]
var segments []string
segments, err = misc.PathToSegments(localPart)
if err != nil {