procmail
[Top] [All Lists]

Re: Filtering e-mail by subject and creating IMAP folder

2002-03-05 03:56:35
On Tue, 5 Mar 2002, Dapid Candra wrote:

[...]
I need help regarding usage of procmail to filter incoming mails
based on part of their subject (e.g. [A123456] ). I want to do some
checking if the folder already exist then forward the mail to the folder,
but if the folder doesn't exist create the folder then forward the mail to
the new folder.

For example, I subscribed to abc mailing list. Postings to the milis will
arrive with subject "[abc] hallo...". I want procmail check if folder
"abc" exist. If it is exist, then forward the mail to "abc" folder.
Otherwise, procmail should create "abc" folder and forward the mail to
"abc" folder.

Have anyone create such procmail recipe?

        Yes, I did, I just cut and paste the example from the man procmailex:

:0 Wic
* ? test ! -d abc
| mkdir abc

:0:
* abc
abc


        Other way which I did not tried:

DUMMY=`test -d abc || mkdir abc`

:0:
* abc
abc


        Hummm, just to feel safe, confirm that your rc file begin with

SHELL=/bin/sh


Bye,
 Udi


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail