Index | Thread | Search

From:
op@omarpolo.com
Subject:
Re: smtpd: improve mask-src behaviour
To:
"Kirill A. Korinsky" <kirill@korins.ky>, "Andrea Pappacoda" <andrea@pappacoda.it>
Cc:
tech@openbsd.org
Date:
Sun, 13 Sep 2026 12:25:05 +0000

Download raw body.

Thread
13 settembre 2026 12:57, "Kirill A. Korinsky" <kirill@korins.ky> wrote:

> On Sun, 13 Sep 2026 03:53:57 +0200,
> Andrea Pappacoda <andrea@pappacoda.it> wrote:
> 
>> This patch makes smtpd's mask-src option behave like Postfix's
>> smtpd_hide_client_session parameter. i.e., the "with SMTP" part of
>> the Received line is now stripped out as well.
>> 
>> This is because RFC 5322 (describing the message format) says that a
>> Received header can contain pretty much anything, while RFC 5321 says
>> that if the message is being processed in an SMTP enviroment then the
>> FROM clause *must* be present as well. Having a Received line saying
>> "with SMTP" with no FROM is a contradiction. Hence, taking it out
>> allows to only fulfill the laxer RFC 5322 format.
>> 
>> This also fixes an issue where a blank line after "Received:" was
>> printed instead of the from line when mask-src is active.
>> 
>> Prompted from a discussion on the misc opensmtpd list.
>> ---
>> 
>> I didn't have the time to test this on my openbsd box, but it should be
>> correct.
> 
> I actually tested it on my setup, and it works as expected:
> 
> Received: by mx1.catap.net (OpenSMTPD) id d9494ca0
> for <kirill@korins.ky>;
> Sun, 13 Sep 2026 12:55:12 +0200 (CEST)
> Received: from localhost (matebook.home.arpa [local])
> by matebook.home.arpa (OpenSMTPD) with ESMTPA id 540e7ffa
> for <kirill@korins.ky>;
> Sun, 13 Sep 2026 12:55:10 +0200 (CEST)
> 
> I think it right things, so OK kirill@ if anyone willing to commit it.

please go on, ok op@

Grazie! :)