
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@htt-consult.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...