procmail
[Top] [All Lists]

Re: adding a missing Date: header

2008-10-03 16:51:55
On 3-Oct-2008, at 14:44, LuKreme wrote:
On 3-Oct-2008, at 12:56, A. Lester Buck III wrote:
:0
* ! ^Date:
{
 DATE_=`ruby -e "require 'time'; print Time.now.rfc2822"`

:0 fhw:
| formail -a "Date: ${DATE_}" -a "X-Date: added date header"
}

Seems to work.

Er.. meant to post a log extract.  here it is:

procmail: [82083] Fri Oct  3 14:45:21 2008
procmail: Match on ! "^Date:"
procmail: Executing "ruby -e "require 'time'; print Time.now.rfc2822""
procmail: Assigning "DATE_=Fri, 03 Oct 2008 14:45:21 -0600"
procmail: Couldn't determine implicit lockfile from "formail"
procmail: Locking ".lock"
procmail: Executing "formail,-a,Date: Fri, 03 Oct 2008 14:45:21 -0600,- a,X-Date: added date header"
procmail: Unlocking ".lock"
procmail: Assigning "LASTFOLDER=SPAM3"
procmail: Opening "SPAM3"
procmail: Acquiring kernel-lock

With the command:

 $ formail -s procmail -m dateadd < SPAM &
 $ cat dateadd
LOGFILE=temp.log
VERBOSE=ON
:0
* ! ^Date:
{
     DATE_=`ruby -e "require 'time'; print Time.now.rfc2822"`

      :0 fhw:
       | formail -a "Date: ${DATE_}" -a "X-Date: added date header"
}

:0
SPAM3
===EOF



--
"Katrina, $4 gas, a trillion dollar war, rising unemployment,
     deregulated housing market, global warming...NO MORE!"
     http://is.gd/2mxY



____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail