procmail
[Top] [All Lists]

Re: addding from lines with formail

2020-05-13 13:56:19


On 5/13/20 2:36 PM, John Levine wrote:
In article <9049a7aa-73be-bb47-de4c-5e1a4d9768c0(_at_)htt-consult(_dot_)com> 
you write:
I am struggling a bit with terminology here.  There is the "regular"
RFC822 email From: header.  I will call that From-header.  Then there is
the mbox start-of-message From line.  I will call that From-mbox.

If I use formail to change various email headers other than the
From-Header, formail creates a From-mbox line that shows the sender as
what is in the existing From-Header.
Right, that's what it does.  Or you can use a -f flag to omit
the mbox From altogether


But it did not use the From: header content.  I am including the message file at the end.


If I user formail to -I replace the From-Header, formail creates a
From-mbox line where the sender is foo@bar.
That's the default if there's no valid From: in the incoming message.

There IS a From: in the original message:

From: "(Cron Daemon)" <rgm>

Now this IS the first line in the message.  I am replacing this via:

-I "From: (Cron Daemon) <$USER@$HOSTNAME>"

Which gets inserted after all the remaining headers.


But formail should not be getting it wrong in the first place to need
procmail to correct it.
It's not wrong even if it's not what you expect.


Well the message HAS a From: header.  Yes, I would expect formail to use it in creating the mbox From header, and not have to resort to foo@bar.


Letting procmail generate the mbox From is a better idea anyway.

Yes.  But it had me confused and delayed me, trying to get formail creating a From mbox line, to finally give up and start on the procmail step to see it get fixed...



From: "(Cron Daemon)" <rgm>
To: rgm
Subject: Cron <rgm@lx140e> rsync -tvz rsync.tools.ietf.org::tools.id/*-hip-*.xml
 /home/common/ietf/drafts/xml
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=270>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/1000>
X-Cron-Env: <DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus>
X-Cron-Env: <XDG_SESSION_TYPE=unspecified>
X-Cron-Env: <XDG_SESSION_CLASS=background>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=rgm>
X-Cron-Env: <HOME=/home/rgm>
X-Cron-Env: <LOGNAME=rgm>
X-Cron-Env: <USER=rgm>
Status: RO
Content-Length: 101
Lines: 3


sent 30 bytes  received 5,001 bytes  402.48 bytes/sec
total size is 10,561,702  speedup is 2,099.32


____________________________________________________________
procmail mailing list -- procmail(_at_)lists(_dot_)rwth-aachen(_dot_)de   
Procmail homepage: http://www.procmail.org/
To unsubscribe send an email to 
procmail-leave(_at_)lists(_dot_)rwth-aachen(_dot_)de
https://lists.rwth-aachen.de/postorius/lists/procmail.lists.rwth-aachen.de

<Prev in Thread] Current Thread [Next in Thread>