On Wed, Jan 28, 2026 at 01:13:19PM +0100, Vincent Lefevre wrote:
On 2026-01-28 11:30:47 +0800, Kevin J. McCarthy wrote:
Maybe this brings us full circle, to either leaving things as they are, or
trying out the reverse line scanner to compensate for verbose return paths,
and not worrying about the crazier example given.  Thoughts, everyone?

Perhaps accept only the strict format by default and have an option
to accept any line starting with "From " as a separator?

How about: with the option set, as long as it's preceded by an empty line which isn't a header separator, and (of course) isn't inside a content-length delimited message, the option will accept any "From ".

The only danger is the Emacs Lisp reader that Kurt mentioned.  But
since the option won't be set by default, the user can always just turn
it back off.

Moreover, I think that in the cases where a "From " line is required
during parsing (e.g. at the start of a mbox file or at a position
obtained from the Content-Length of the previous message), it is
always safe to accept any "From " line format (instead of giving
an error saying that the mailbox is corrupted).

Okay.

expect_from_line is turned on at the beginning of the parse, and after a content-length delimited message.

has_mbox_sep is set in non-content-length delimited messages when an empty line is in the body (the headers and header separator are read in by mutt_read_rfc822_header, so won't be checked as such).

So we could turn on "From " only mode:

if expect_from_line || (lax_option_set && has_mbox_sep)
  turn on "From " only mode
else
  is_from_reverse_scan() required to be considered a "From " line.

Did I understand you correctly?  Kurt what do you think?

--
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