Confession time: I've never used the -m, and only have the
vaguest idea what turning "procmail into a general purpose
mail filter" is supposed to mean (see "man procmail"); or
why I might want to. I know that what I used above skips
any /etc/procmailrc, too. Can someone explain -m better than
the man pages do?
-m leaves ORGMAIL unset, skips the sanity check on $ORGMAIL, does
pre-set DEFAULT (to what $ORGMAIL would have been), defaults MAILDIR to
the cwd of the invocation rather than defaulting it to $HOME, and passes
its remaining positional parameters (after -m, any command-line variable
assignments, and one rcfile) to the rcfile as "$@" with their count as $#.
I've found it useful for wedging into outgoing mail if your MUA allows
it. Instead of letting the mail client invoke the MTA directly, you can
do some massaging by making it call procmail -m instead. Then when
procmail is done with its filtering and logging, it can pass the message
to the MTA for actual dispatch if the rcfile ends this way:
That way procmail invokes the MTA with the same positional parameters
with which the MUA would have invoked it.
-m also (I've never done this) is useful when procmail is at the start
or in the middle of a pipeline. Just toss
at the start of the rcfile and procmail will pass its output to the next
command in the pipeline. Why would you put procmail there? For
conditional filtering or logging based on content, I'd guess. You could
do that without -m, but when you know you don't want mail saved to
$ORGMAIL -m has the efficiency of skipping the sanity check and of not
writing to $ORGMAIL if the save to $DEFAULT fails.
procmail mailing list