On Sun, Jan 25, 2026 at 08:27:35PM -0500, Kurt Hackenberg wrote:
On Sun, Jan 25, 2026 at 06:09:39PM +0800, Kevin J. McCarthy wrote:

See gitlab issue 433.

This changes the From line parser to work in reverse.  When it gets to
the return path, it just slurps it all in, allowing the address parser
to make sense of it separately.

When the new code slurps it all in, how does it know where to stop? Does it count on recognizing date-time syntax? What if that syntax is unusual?

Both parsers verify the initial "From " prefix. I factored out the code to verify the parts of the date and in the new parser work backwards: year, timezone, time, day, month, weekday. If all that passes it uses whatever comes after the "From " and before the weekday, if anything, as the return path.

Does Mutt have any regression testing of its mbox parsing?

No, but please do help test. Since I'm reusing most the the existing code, just in reverse order, I don't feel like this is a really delicate change. However, Vincent helped test and I've run it against the mbox files I have in both forms, and it seems alright.

--
Kevin J. McCarthy
GPG Fingerprint: 8975 A9B3 3AA3 7910 385C  5308 ADEF 7684 8031 6BDA

Attachment: signature.asc
Description: PGP signature

Reply via email to