procmail
[Top] [All Lists]

Re: A rule to copy all message to a maildir, and then keep processing

2009-11-19 06:42:40
is there a way to copy all messages to a certain maildir or mailbox,
say "archives", or "all_mail", and then keep processing, so to then
move the message according to the other rules?

Have a look at usage of the "f" flag which makes the recipe act in
filter mode not delivery mode. The "f" flag indicates that the pipe is
a filter and does not deliver the message. Procmail processing will
continue after this recipe using the output of the pipe to replace the
input.

A (modified) example of how I use it is below. I use a series of
filter mode recipes to add custom headers to the email, then when I've
applied all those I send the email off to dovecot where some dovecot
sieve recipes check the headers and deliver the email accordingly.

:0 wf
 # Check if email is from person A
 * ^From:(_dot_)*personA(_at_)isp\(_dot_)com\(_dot_)au
 | formail -A "X-PMERule: person A email"

:0 wf
 # Check if email is from person B
 * ^From:(_dot_)*personB(_at_)isp\(_dot_)com\(_dot_)au
 | formail -A "X-PMERule: person B email"


# Finally - send the email (with newly added custom headers) off to
dovecot for delivery to phill's imap folders.
:0
 | $DELIVER -d phill
____________________________________________________________
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