using procmail rules to handle old maildir

Giorgos Keramidas keramida at ceid.upatras.gr
Mon Sep 26 23:12:43 PDT 2005


On 2005-09-27 06:43, Brian Josefsen <josefsen at wasd.dk> wrote:
> Hello all
>
> I don't know if it's appropriate to ask this question here, but now i'll
> give it a try.
>
> I've set up postfix on a new box with maildir support, and i've been
> using procmail to deliver all my mail, so i now have the rules i've always
> missed.
>
> Then i've taken a tarball from the vhosting environment from the old
> server, so i have now a Maildir that i use, with all my new mail in it,
> and another Maildir with all the old mail.
>
> Now i would like to sort all my old mail using the procmail rules i have
> now, it could be as easy as:
> cd oldmaildir
> procmail < find . -type f -exec echo {} \;
>
> but procmail don't delete the mail from the old maildir, and since there
> is ~9k mail, i would hate to first filter all of it, and then go
> manually through all of it again.
>
> Anyone out there with any idea to solve this would be highly appreciated
> as i depend on "quick" access to old mail.
>
> FreeBSD 5.4, latest procmail, mutt zsh.

AFAIK, procmail cannot filter Maildir/ files.  You'll have to convert
the old Maildir/ to UNIX mbox format.  Then you can use formail and
procmail to filter it all through your current .procmailrc rules:

	$ formail -s procmail < oldmail.mbox

That should take care of it all :)  Then you can delete oldmail.mbox



More information about the freebsd-questions mailing list