https://gitlab.synchro.net/main/sbbs/-/commit/e0b7043e35c210a67ec71999
Modified Files:
src/sbbs3/mailsrvr.cpp
Log Message:
mailsrvr: don't mistake a quoted address local-part for a display name
A QWKnet reply sent via SMTP failed to import at the destination BBS:
QWK NetMail from VERT to EOTLBBS!nelgin
!QWK NetMail from VERT to UNKNOWN USER: EOTLBBS!nelgin
smtp_netmailaddr() renders a QWKnet sender as qwkid!user@host, so a
reply is addressed to e.g. <EOTLBBS!
nelgin@vert.synchro.net> -- and a
mail client may quote the local part, which RFC 5322 allows:
To: nelgin <"EOTLBBS!nelgin"@vert.synchro.net>
parse_mail_address() took the first quote anywhere in the string as the
start of a display name, so it returned "EOTLBBS!nelgin" as the name.
The SMTP envelope had been parsed correctly (recipient "nelgin", routed
to QWKnet node EOTLBBS), but the To: header re-parse overwrites the same buffer, and that name is what gets stored as the message recipient. The
QWK packer writes it verbatim, and the receiving system finds no such
user.
Treat a quote as a display-name delimiter only where a display name can
appear -- before the '<' of the address -- and, for a QWKnet recipient,
take the name from the envelope rather than the To: header, as the
FidoNet case already does. The header parse also feeds the sender name
of unauthenticated mail, so an odd From: address was mangled the same
way.
The quoted/parenthesized display-name handling dates to cbcda654b4 (2002-08-22).
Co-Authored-By: Claude Opus 5 (1M context) <
noreply@anthropic.com>
--- SBBSecho 3.37-Linux
* Origin: Vertrauen - [vert/cvs/bbs].synchro.net (1:103/705)