procmail
[Top] [All Lists]

RE: adding a missing Date: header

2008-10-03 20:14:26
Dallman Ross wrote Saturday, October 04, 2008 1:28 AM:

[N]ote that each message coming in has a
timestamp in the From_ header.  Let's use it.


  # ----------- start date-adding rc-file ------------

  :0
  * ! ^Date:
  * ^^.* \/(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*
  {
      FROM_DATE = $MATCH

[deleted]

I suggest changing the second condition.  The recipe now would be:

  :0
  * ! ^Date:
  * ^^(_dot_)+(_at_)(_dot_)+ \/(Mon|Tue|Wed|Thu|Fri|Sat|Sun).*
  {
     . . . .


The reason is that the original could match on part of an email
address that includes the three letters making up weekday abbreviations.
The updated regex won't match wrongly in such a case.

Also, clarifying the syntax, "^^" means start or end of entire
search area.  So this is the From_ line, even if I don't type in "^From ".

Dallman

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