Mprocmail, P=/usr/bin/procmail, F=mSDFMhun, S=11, R=21, A=procmail -m $h $g $uThis enables you to use rules like the following (most likely in ruleset 0) to filter mail through the procmail mailer (please note the leading tab to continue the rule, and the tab to separate the comments):
R$*<@some.where>$* $#procmail $@/etc/procmailrcs/some.rc $:$1@some.where.procmail$2 R$*<@$*.procmail>$* $1<@$2>$3 Already filtered, map backAnd /etc/procmailrcs/some.rc could be as simple as:
SENDER = "<$1>" # fix for empty sender addresses SHIFT = 1 # remove it from $@Do watch out when sending mail from within the /etc/procmailrcs/some.rc file, if you send mail to addresses which match the first rule again, you could be creating an endless mail loop.
:0 # sink all junk mail * ^Subject:.*junk /dev/null
:0 w # pass along all other mail ! -oi -f "$SENDER" "$@"
"h'-w' 'u' |exec /usr/bin/procmail"
|/usr/bin/procmail
#!/bin/shfi exit 0 "A sample small $HOME/.procmailrc:"
ORGMAIL=/var/mail/$LOGNAME
if cd $HOME && test -s $ORGMAIL && lockfile -r0 -l1024 .newmail.lock 2>/dev/null then trap "rm -f .newmail.lock" 1 2 3 13 15 umask 077 lockfile -l1024 -ml cat $ORGMAIL >>.newmail && cat /dev/null >$ORGMAIL lockfile -mu formail -s procmail <.newmail && rm -f .newmail rm -f .newmail.lock
PATH=/usr/local/bin:/usr/bin:/bin MAILDIR=$HOME/Mail #you'd better make sure it exists DEFAULT=$MAILDIR/mbox #completely optional LOGFILE=$MAILDIR/from #recommended :0: * ^From.*berg from_me :0 * ^Subject:.*Flame /dev/null