procmail
[Top] [All Lists]

Re: Extract Year and Month from email

2007-08-23 10:46:38
On Thu, Aug 23, 2007 at 12:54:19PM -0400, rouble wrote:
Is there a way to write a procmail recipe to achieve the
following:

:0:
<Some Condition>
.Mail.{Year from Date header of this mail}.{Month from Date header of this 
mail}

 :0 D
 * ^Date:.* \/[JFMASOND].*:
 * MATCH ?? ^^.*[^ ]
 {
    MY = $MATCH

    :0
    * MY ?? ^^\/[a-z]+
    { MONTH = $MATCH }

    :0
    * MY ?? ()\/[0-9]+
    { YEAR = $MATCH }

    :0
    | echo "${MONTH}.${MONTH}" | $SENDMAIL someone(_at_)address
 }

That works, but the $SENMAIL part needs more refinement.

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