procmail
[Top] [All Lists]

Re: Procmail -f cron does not have a date header - how to add

2020-05-10 22:29:24


On 5/10/20 11:13 PM, Robert Moskowitz wrote:


On 5/10/20 11:04 PM, John Levine wrote:
In article <eaed1094-7f89-f9ba-e5b5-8f26baec940c(_at_)htt-consult(_dot_)com> you write:
I have dug around a bit and can't seem to find a way for procmail to add
a DATE header.

How may I do this?
With a kludge, I'd say, something like this:

:0 f
! date +"Date: %a, %d %b %Y %T %z"; cat


John,

And where would this go? Given that I am running procmail within cron via:

CRONDARGS=-m "/usr/bin/procmail -f cron"

I dug around and read a bit about formail that comes with procmail and came up with:

formail -i "Date: $(date +'%a, %e %b %Y %T %z (%Z)')" >> /var/spool/mail/$USER < [cron output]

I tested this by cutting out a cron output from my mbox and then inputting that file in the above.

But I don't know how to put that formail command into the crondargs.  Plus I don't like that I have to pipe out into my mbox...

A refinement after reading more about formail:

formail -i "Date: $(date +'%a, %e %b %Y %T %z (%Z)')" -s procmail

Where stdin is the output of cron.

But how to get that into the crondargs line...

____________________________________________________________
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