About the format of "From " lines, there is RFC 4155, but it was
written in 2005 (thus it is more or less pointless for older mbox
files) and is only informational. Its Appendix A has

  Appendix A.  The "default" mbox Database Format

   In order to improve interoperability among messaging systems, this
   memo defines a "default" mbox database format, which MUST be
   supported by all implementations that claim to be compliant with this
   specification.

So this is just a *default* mbox format, apparently for *new* mbox
files. This does not mean that software should stick to this format
when *reading* mbox files. But mbox files generated by current
software should have this format. About the "From " line, it says:

      o Each message in the mbox database MUST be immediately preceded
        by a single separator line, which MUST conform to the following
        syntax:

           The exact character sequence of "From";

           a single Space character (0x20);

           the email address of the message sender (as obtained from the
           message envelope or other authoritative source), conformant
           with the "addr-spec" syntax from RFC 2822;

           a single Space character;

           a timestamp indicating the UTC date and time when the message
           was originally received, conformant with the syntax of the
           traditional UNIX 'ctime' output sans timezone (note that the
           use of UTC precludes the need for a timezone indicator);

           an end-of-line marker.

There are at least 2 bugs in Mutt (see an example below):

1. In some cases, it fails to generate an email address having the
   "addr-spec" syntax from RFC 2822.

2. The generated timestamp is set to the local time instead of UTC time.

I did a test with a message in a maildir mailbox that just contained
the headers

  Return-Path: <>
  To: [email protected]

(since it is in a maildir mailbox, there is no "From " line).
Note that the Return-Path is valid (used by mailer-daemons).
When I copied the message to a (new) mbox file, I obtained the
following "From " line:

  From @ Thu Jan 29 16:16:11 2026

The @ does not have the "addr-spec" syntax from RFC 2822 since the
local-part and domain cannot be empty strings. And the date uses
the local time instead of UTC time.

Moreover, RFC 4155 references

  http://qmail.org./man/man5/mbox.html

which says "A From_ line means any line that begins with the characters
F, r, o, m, space". Note the "any line". It later says:

  The From_ line always looks like From /envsender/ /date/
  /moreinfo/.  /envsender/ is one word, without spaces or tabs; it
  is usually the envelope sender of the message.  /date/ is the
  delivery date of the message.  It always contains exactly 24
  characters in asctime format.  /moreinfo/ is optional; it may
  contain arbitrary information.

This seems contradictory to what was said at the beginning, unless
it is meant to be what is generated by qmail (also, "looks like"
is not a requirement).

-- 
Vincent Lefèvre <[email protected]> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Reply via email to