[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [nmh-workers] Flagging messages

From: Robert Elz
Subject: Re: [nmh-workers] Flagging messages
Date: Mon, 27 May 2019 05:49:35 +0700

    Date:        Sun, 26 May 2019 11:29:07 -0400
    From:        "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" <address@hidden>
    Message-ID:  <address@hidden>

  | I even went back and checked rfc822, and it says:
  |      field       =  field-name ":" [ field-body ] CRLF
  |      field-name  =  1*<any CHAR, excluding CTLs, SPACE, and ":">

Ah, the mysteries of RFC-822...

If you go back and really read that, you'll discover that you're
allowed to have horizontal white space (ie: spaces and tabs)
between any two tokens in the grammar, so when it writes

        field-name ":" [ field-body ] CRLF

there can be whote space between the field-name and the ":", between
the ":" and the optional field-body (or the CRLF) and between the
optional field-body and the CRLF.

  | So what is that '[ \t]*' there for?

For that.   But it isn't really adequate (unless comments have
already been removed from the field) as anywhere that white space
is permitted, comments (strings in parentheses) are also permitted,
so RFC-822 permits

        to (you should really read this message) : addr, ...
        cc (for your information, if you care) : addr, ...

  | Does that ever actually happen?

Spaces, yes, it used to once - some people/mailers liked to line
up the colons so it all looked neat.   Back in the days when people were
generally show messages more or less raw.   Comments, not that I have
ever seen.   But it was rare, even back in the 70's and early 80's.

But I think 2822 or 5322 or something has tightened the rules,
certainly 2822 got rid of the "spaces or comments between any
two tokens" stuff, as if you look at it carefully, that allows
spaces (and comments) in some of the most bizarre places, like
around the ':' chars in a time
        17 (hours) : (and) 23 (minutes) : (plus) 19 (seconds)
is a legal RFC-822 time.    Almost nothing would correctly
parse that.

So the grammar was changed to explicitly specify where spaces,
and where comments, could be inserted (in the middle of a time
is not one of them).   I don't recall whether before the ":"
after a field-name is one of them however (I tend to assume not,
and I should check, but...).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]