---
Hi Krill,
On Sat Sep 12, 2026 at 3:34 AM CEST, Kirill A. Korinsky wrote:
> well, this is quite trivial to fix:
Thanks for the patch :)
It fixes only one of the two issues I mentioned, though. Not only I was
arguing for getting rid of the blank line, but also of the "With" part
of the message, which allows for getting rid of from. In other words, if
"with SMTP" is present, "from" must be present too. But, as "with" is
not mandatory, getting rid of "with" allows getting rid of "from"
without breaking the rules.
Here's an untested patch which does what I meant, motivated by xkcd 386.
usr.sbin/smtpd/smtp_session.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index bc7d864fc54..64b706ab487 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -2769,20 +2769,25 @@ 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) ",
s->smtpname,
- SMTPD_NAME,
+ SMTPD_NAME);
+
+ if (!(s->listener->flags & F_MASK_SOURCE)) {
+ m_printf("with %sSMTP%s%s "
s->flags & SF_EHLO ? "E" : "",
s->flags & SF_SECURE ? "S" : "",
- s->flags & SF_AUTHENTICATED ? "A" : "",
- tx->msgid);
+ s->flags & SF_AUTHENTICATED ? "A" : "");
+ }
+ m_printf("id %08x", tx->msgid);
if (s->flags & SF_SECURE) {
m_printf(tx, " (%s:%s:%d:%s)",
--
2.53.0