Re: Maildir format

Jack Bertram <[email protected]> Tue, 13 May 2003 14:57:20 +0100
Newsgroups gmane.mail.ifile.general
Message-ID <[email protected]>
* Brett N <[email protected]> [030513 14:26]:
> Is there anyway I can use the refile.learn scripts with Maildir format? I
> looked around and I couldn't find a whole lot of resources. I know how to
> change the destination folders in the procmail file, but I don't know how
> to replace all the formail statements. Is that all that needs to be done??

Assuming you're talking about my script, then all the formail statement
is doing is splitting up an mbox file into discrete messages to pass to
procmail, so you could replace it with something like

for msg in $(ls $MAILDIR/cur); do cat $msg | procmail -m FOLDER =$MAILDIR $HOME/bin/refile.learn.rc; done

> BTW, what else needs to be done differently to support Maildir?

I'm not quite sure off the top of my head what other changes you would
make to cope with Maildir format, as I don't use it.

However, you could certainly make the process more efficient - changing
a message in a mbox requires rewriting the whole mbox, whereas changing
a message in a Maildir should only involve rewriting one file.  If you
had the right approach, then this would make the scripts a lot simpler.

jack