procmail
[Top] [All Lists]

RE: Filtering existing email using procmail/formail

2008-03-04 17:16:03
Ben Stasiewicz wrote Sunday, March 02, 2008 11:31 PM:

I would like to be able to filter all of my existing email through 
procmail so that they too can be placed in the appropriate 
Maildir folders.

I used formail to do this with the command 'formail -s procmail
< /path/to/an/email'. This worked well but unfortunately none
of the Maildir status flags were preserved (as I expected). For
example 'D' for draft messages, 'R' for messages I have
replied to, 'S' for messages I have seen etc. For now I am
using my IMAP client to manually move emails to the correct
Maildir folder. Is there a way I can automate this using
formail/procmail and still preserve any of the Maildir status
flags?

The problem is that Maildir uses a different schema to "mark"
messages.  Namely, it usually (depending on your system
and software) renames the file itself and moves it to
a different directory in order to mark the message read, etc.

So you would have to have procmail look for an existing
Status header and save the message the right way depending
on what it finds.  It's not all that difficult, but it
would take a bit of work to get it right.  We had some
threads here in the last half-year or year on the manner
of Maildir file-renames for marking messages read.  I suggest
you search the list archives from the link fairly low down on
the page at procmail.org.  There were some sample recipes
offered and discussed, as I recall.

Dallman


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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