> Maybe I'm confused (usually am :), but it sounds to me like you want to
> filter a maildir "in place", moving stuff that matches the recipes but

I didn't quite follow the thread closely but all the issues I saw are
trivially solved in procmail. If you want to filter an existing mailbox
and store its mail either there or there, it's called if-else and every
programming language has it.

In any case you will have to call procmail for each(!) email in that
box. If it's mbox, use formail -f -b -s <MAILBOX to split it. This may
also work for maildir mailboxes, although there you could obciously
also use a shell loop.

To process:

:0:
* your condition
SAVE-HERE

:0:
SAVE-ELSEWHERE


If the first recipe doesn't match, the second will.

You can tell procmail which recipe file to use for filtering. THis
allows you to run this without having to worry about your normal mail
filtering setup (which uses ~/.procmailrc). Note you still need to set
a few other variables, notably LOGFILE and DEFAULT, to shift logging to
a different file and to save to a different default mailbox in case you
stuffed your recipes somehow.

Because I do this reasonably often, I wrote a few scripts for this. 
The shell part is

        formail -f -b -s <MAILBOX procmail wrapper.rc

The wrapper.rc is in http://volker.dnsalias.net/soft/procmail/
It includes another file into which you only put the recipes for this
particular filter job, and you don't have to change wrapper.rc.

Obviously, adjust all to your liking.

Volker

-- 
Volker Kuhlmann                 is possibly list0570 with the domain in header
http://volker.dnsalias.net/             Please do not CC list postings to me.

Reply via email to