procmail
[Top] [All Lists]

Re: mail from the future

2007-02-06 17:36:05
On Wed, Feb 07, 2007 at 12:15:25AM +0100, ignotus(_at_)freemail(_dot_)hu wrote:
Hello, rarely I get mail "from the future" (the Date header carries a
date that is in the future).  In this case, I would like to replace the
Date header with the current date from procmail, how can I do that?  I
am sure lot of people would like to have a solution for this.

Not sure why you want to do that, since dates more than an hour
in the future are very reasonable indicators of likely spam,
if the party sending is not in one's whitelist.

But basically, your algorithm is, you need to look at the date
and figure it out somehow.  It's not that easy to do in procmail,
but I do do it.  I have a complex set of recipes that look just
for that.  It's not something I'd want to publish in full, however.
You could, alternatively, use GNU date to compare the date with
the current one.

Once your algorithm decides the date is in the future, you can use
formail to replace the string with $DATE (which you will have set,
e.g.,

  DATE = `date +some_options`

).  Or, better yet, take $DATE from the From_ line, which your
own procmail iteration can generate (e.g., if run as
"procmail -t -f-" -- see man pages).

Once you decide to replace the Date: header's data field,
use, e.g.,

  :0 fw hi
  | formail -i "Date: $DATE"


Dallman





Thanks in advance,
Richard



____________________________________________________________
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

____________________________________________________________
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

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