On 2019-06-07 07:22, Cameron Simpson wrote:

Are you looking in mbox files or in other places. [...] Hmm, my maildir message files also have From_ lines.

If fetchmail's delivering to a programme, nothing prevents that being an arbitrary script to premangle a leading From_ line. Hmm. I've got a script in my bin directory called "unfrom_" for exactly this purpose, which reads:

  #!/usr/bin/env sed -f
  #
  # Transmute leading "From " line on email message, if any.
  #    - Cameron Simpson <c...@cskk.id.au> 13jul2002
  #

  1{s/^From /From_: /}

You can just include that script in a pipeline ahead of maildrop.

Yep.

I've also seen From_ lines in maildir message files, and on the stdin of delivery agents. Both are wrong, in my opinion. I think mbox From_ lines should not exist anywhere outside mbox files.

I've written a script much like yours, to drop the damn From_ line from an incoming message passed to a delivery agent. I think your script does something that's not quite right: it transforms the mbox From_ line to something that's not RFC 822. You could do, say,

    s/^From /X-Mbox-From: /

Or -- my recommendation -- just drop it. (Of course, drop it only if that first line really is an mbox From_ line.)

Reply via email to