procmail
[Top] [All Lists]

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

2020-05-10 22:45:15
In article <0a1decb2-3df5-c1aa-cf8a-3994851919b3(_at_)htt-consult(_dot_)com> 
you write:
With a kludge, I'd say, something like this:

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

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

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

It's a procmail recipe, it goes in .procmailrc

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

That would do it, too.

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...

Put it into the .procmailrc like this:

:0 f
! formail -i "Date: $(date -R)"

Procmail should store the message in your mbox when it runs out of
things to do in the .procmailrc so it doesn't need that >> redirect.
-- 
Regards,
John Levine, johnl(_at_)taugh(_dot_)com, Primary Perpetrator of "The Internet 
for Dummies",
Please consider the environment before reading this e-mail. https://jl.ly
____________________________________________________________
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>