procmail
[Top] [All Lists]

Re: processing inbox maildirs with formail

2007-08-27 10:56:39
On Mon, Aug 27, 2007 10:01:39 AM -0700, Bart Schaefer 
(barton(_dot_)schaefer(_at_)gmail(_dot_)com) wrote:
 
You don't need formail here.  There's only one message in $file, so
formail has nothing to "split" (the meaning of -s).  Simply do

Argh!, of course! Thanks for spotting this and for the SWITCHRC
trick. And of course:

I would also suggest that you avoid looping over cur/* and instead do only

this is another good point. I am not doing it yet, simply because I am
still testing, but I agree that's necessary too.

for file in new/*
do
/usr/bin/procmail -m test/rcfile.rc < $file
mv $file cur
done

Otherwise you need some alternate way to avoid re-processing the same
files every time your script runs.  Unless that's the idea, in which
case go right ahead ...

Actually, I need to put together several of these scripts. Some of
them will be able to simply delete the message after procmail has
worked on it.

Generally speaking, there is another thing I have realized. A few of
these scripts do need to use procmail, either to do things which are
much simpler with procmail or to reuse recipes which are already
tested to do just what I need.

Other operations, however, could be done with simple shell scripting:
what is stopping me is that I haven't found yet any guideline to write
shell scripts which mess with maildir. That is, under which conditions
it is sure to move or delete (the Unix way, with mv or rm) a message
from mailbox1/new/ to mailbox2/new, when one or both mailboxes are
served via IMAP to remote users?

What is advisable and most efficient? Use locks (how?), only work on
file which are at least one minute old? What else?

Tips or pointers about this (probably off list, it's not about
procmail, is it?) are very welcome.

Ciao,
        Marco
____________________________________________________________
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