procmail
[Top] [All Lists]

Re: Can procmail be used to move mail between folders?

2001-07-31 01:58:57
On Sat, Jul 28, 2001 at 16:18:52AM +0100, David Tamkin wrote:
Lawrence Mitchell's answer to Tim Allen was *so* close, except right here:

| Thus, if you
| set up a procmailrc to do this sorting, you could run it like this:
| procmail $procmailrc < mailbox

That should be something more like

  formail -s procmail < sentfolder

or

 formail -s procmail -m special_rcfile_for_sent_items < sentfolder

There is an example in the procmail(1) manual page of how to reprocess
mail
you've already received.

Everything else Lawrence said is right on the money.


Many thanks for this and the other two responses with similar suggestions. I
have a couple of questions about this method:

1. The imap server is wu-imap running on RH7.1. Is there any way to lock
sentfolder while performing this action to prevent wu-imap from adding to
the sentfolder while I'm passing it through formail? Or is it a matter of
running the cron job at 2.00 am on the assumption that everything's quiet
then? I've been looking at lockfile but can't see that's relevant to this.

2. I want to *move* entries from sentfolder, not just copy them. I can see
two ways of doing this. Either remove sentfolder after passing through
formail, and re-initialize. Or use formail a second time as a filter to
change the X-Status: header to D. Both these throw up the locking question
again as there's the risk here of losing messages if sentfolder is added to
while doing this.




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