From 57fc37af2296bfa7114abd8dffd8edb88efec2e7 Mon Sep 17 00:00:00 2001 From: Mechiel Lukkien Date: Wed, 20 Dec 2023 21:01:47 +0100 Subject: [PATCH] if an smtp-submitted message has a return-path header, only fail in pedantic mode some software sends messages with return-path header. for issue #103 by Halyul, thanks for reporting! --- smtpserver/server.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/smtpserver/server.go b/smtpserver/server.go index 99241ca..e9be0f6 100644 --- a/smtpserver/server.go +++ b/smtpserver/server.go @@ -1819,9 +1819,9 @@ func (c *conn) submit(ctx context.Context, recvHdrFor func(string) string, msgWr // Outgoing messages should not have a Return-Path header. The final receiving mail // server will add it. // ../rfc/5321:3233 - if header.Values("Return-Path") != nil { + if mox.Pedantic && header.Values("Return-Path") != nil { metricSubmission.WithLabelValues("badheader").Inc() - xsmtpUserErrorf(smtp.C550MailboxUnavail, smtp.SeMsg6Other0, "message must not have Return-Path header") + xsmtpUserErrorf(smtp.C550MailboxUnavail, smtp.SeMsg6Other0, "message should not have Return-Path header") } // Add Message-Id header if missing.