On Sat, 12 Sep 2026 02:26:38 +0200,
"Andrea Pappacoda" <[email protected]> wrote:
> 
> On Sat Sep 12, 2026 at 1:45 AM CEST, Thomas Bohl wrote:
> > Ignoring the filter discussion, isn't mask-src on the submission port
> > enough (to avoid exposing internal details)? I use it for the exact
> > purpose.
> 
> Speaking of which, maybe it'd make sense to reimplement it in a similar
> was as Postfix does, which apparently is more compatible and strictly
> standards compliant? [1]
> 
> OpenSMTPD's mask-src does this:
> 
>    Received:
>            by mesiano (OpenSMTPD) with ESMTPA id c9aca955
>            for <[email protected]>;
>            Sat, 12 Sep 2026 00:13:35 +0000 (UTC)
> 
> While Postfix's smtpd_hide_client_session does this instead:
> 
>    Received: by mail.pappacoda.it (Postfix) id ABBB223545
>            for <[email protected]>; Sat, 12 Sep 2026 02:13:35 +0200 (CEST)
> 
> i.e. smtpd drops the "from" line entirely, leaving a blank line instead,
> while postfix also stops saying "with ESMTPA" in the "by" line (and does
> not leave any blank line behind).
> 
> [1]: "The redacted form hides that a message was received with SMTP, and
> therefore it does not need to provide the FROM clause according to RFC
> 5321 section 4.4. The redacted form still meets RFC 5322 requirements.",
> https://www.postfix.org/postconf.5.html#smtpd_hide_client_session
> 

well, this is quite trivial to fix:

Index: usr.sbin/smtpd/smtp_session.c
===================================================================
RCS file: /home/cvs/src/usr.sbin/smtpd/smtp_session.c,v
diff -u -p -r1.449 smtp_session.c
--- usr.sbin/smtpd/smtp_session.c       26 May 2026 22:43:32 -0000      1.449
+++ usr.sbin/smtpd/smtp_session.c       12 Sep 2026 01:33:44 -0000
@@ -2769,14 +2769,14 @@ smtp_message_begin(struct smtp_tx *tx)
 
        m_printf(tx, "Received: ");
        if (!(s->listener->flags & F_MASK_SOURCE)) {
-               m_printf(tx, "from %s (%s %s%s%s)",
+               m_printf(tx, "from %s (%s %s%s%s)\n\t",
                    s->helo,
                    s->rdns,
                    s->ss.ss_family == AF_INET6 ? "" : "[",
                    ss_to_text(&s->ss),
                    s->ss.ss_family == AF_INET6 ? "" : "]");
        }
-       m_printf(tx, "\n\tby %s (%s) with %sSMTP%s%s id %08x",
+       m_printf(tx, "by %s (%s) with %sSMTP%s%s id %08x",
            s->smtpname,
            SMTPD_NAME,
            s->flags & SF_EHLO ? "E" : "",



-- 
wbr, Kirill

Reply via email to