procmail
[Top] [All Lists]

Re: Brauche ein recipe

1998-07-28 02:47:55
On Mon, 27 Jul 1998 18:22:32 +0200 (MET DST),
speedboy(_at_)uni-paderborn(_dot_)de wrote:
das alle bei mir ankommenden Mails, mit abc(_at_)uni-paderborn(_dot_)de im 
To-Header
in die Datei IN.abc umleitet. Nun moechte ich aber, dass ab dem 1. August,
alle Mails mit abc(_at_)uni-paderborn(_dot_)de im To-Header in die Datei 
IN.abc-August
umgeleitet werden. Alle anderen Mails (also die bis zum 1.August bei mir
eintruddeln) sollen weiterhin in IN.abc verschoben werden.
Was muss ich tun? Ich arbeiter unter SunOS 5.5.

Assuming you would like the mails in September to go to IN.abc again,

    :0:
    * ^From [^          ]*  ... Aug
    * ^TO_abc(_at_)uni-paderborn\(_dot_)de
    IN.abc-August

    :0:
    * ^TO_abc(_at_)uni-paderborn\(_dot_)de
    IN.abc

If your From_ lines look different than mine, you'll have to tweak
this somewhat. The intent is to match the date stamp's month name part
(mine look like

  From nobody(_at_)UU(_dot_)NET  Tue Jul 28 12:14:24 1998
                          ^^^
This is the part I'm trying to match. If you want to split into
folders named by month name and are content with English month name
abbreviations, grab this into MATCH and use that for filing:

    :0:
    * ^From [^          ]*  ... \/...
    * ^TO_abc(_at_)uni-paderborn\(_dot_)de
    IN.abc-$MATCH

You could easilty add an extra condition to momentarily exclude July
1998 if you only want this starting from August 1998:

    :0:
    * ! ^From [^        ]*  ... \/Jul .. ..:..:.. 1998
    * ^From [^  ]* ... \/...
    * ^TO_abc(_at_)uni-paderborn\(_dot_)de
    IN.abc-$MATCH

You could in principle use the Date: header [or even run date(1) in
your .procmailrc each time you receive a message, but that's a bit of
a waste of resources] but I believe From_ should be more reliable [you
would have to prefer Resent-Date: over Date:, and even then will it be
indicative of the time the message was sent, rather than when you
received it. Furthermore, there are many programs which produce
nonstandard Date: fields.)

Hope this helps,

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>

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