procmail
[Top] [All Lists]

Filtering all incoming and outgoing mail

2000-05-04 16:58:29
Hi,

I've seen this question asked time and time again in the archives, but I
seem to be doing something wrong here.  I've got a machine that accepts
mail on behalf of a few domains, and then forwards them to the appropriate
mail server based on the mailertable and some dns-oddities.

In /etc/sendmail.cf I have

Mprocmail,      P=/usr/bin/procmail, F=mSDFMhun, S=11, R=21,
                A=procmail -m $h $g $u

S98
# Mail filtering
R$*<@$+>$*      $#procmail $@/etc/procmailrcs/filter.rc $:$1(_at_)$2procmail$3
R$*<@$*.procmail>$*     $1@<$2>$3       map back of procmail copy

and /etc/procmailrcs/filter.rc is

LOGFILE = /tmp/procmail.log
SENDER = $1
SHIFT = 1

:0
* ^Subject:.*junk
        /tmp/junked

:0                              # pass along all other mail
        ! -f "$SENDER" -- "$@"

When I send a message without the subject of "junk" from the local
machine, 

May 4 18:46:38 phoenix sendmail[29019]: SAA29019: from=sean, size=5,
class=0, p ri=30005, nrcpts=1,
msgid=<200005042346(_dot_)SAA29019(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca>, 
relay=root@ localhost
May 4 18:46:38 phoenix sendmail[29019]: SAA29019: to=sean(_at_)escape(_dot_)ca,
ctladdr=se an (500/4), delay=00:00:03, xdelay=00:00:00, mailer=procmail,
relay=/etc/procmailrcs/filter.rc, stat=Sent
May 4 18:46:38 phoenix sendmail[29021]: SAA29021:
from=sean(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca, size=274, class=0, 
pri=30274, nrcpts=1,
msgid=<200005042346(_dot_)SAA29019(_at_)phoenix(_dot_)hsc .mb.ca>, 
relay=root(_at_)localhost
May 4 18:46:38 phoenix sendmail[29023]: SAA29021:
to=sean(_at_)escape(_dot_)ca(_dot_)procmail@phoenix.hsc.mb.ca,
ctladdr=sean(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca (0/0), delay=00:00:00, 
xdelay=00 :00:00,
mailer=procmail, relay=/etc/procmailrcs/filter.rc, stat=Sent
May 4 18:46:38 phoenix sendmail[29025]: SAA29025:
from=sean(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca, size=433, class=0, 
pri=30433, nrcpts=1,
msgid=<200005042346(_dot_)SAA29019(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca>, 
relay=root(_at_)localhost
May 4 18:46:38 phoenix sendmail[29027]: SAA29025:
to=sean(_at_)escape(_dot_)ca(_dot_)procmail(_dot_)procmail@phoenix.hsc.mb.ca,
ctladdr=sean(_at_)phoenix(_dot_)hsc(_dot_)mb(_dot_)ca (0/0), delay=00:00:00, 
xdelay=00:00:00,
mailer=procmail, relay=/etc/procmailrcs/filter.rc, stat=Sent

Sendmail 8.9.3, procmail 3.13.1, on a Linux box.

Any help would be appreciated.  Please cc me in replies, I'm not on the
list yet.

Thanks!

Sean

-------------------------------------------------------------------
Sean Walberg <sean(_at_)escape(_dot_)ca>            http://www.escape.ca/~sean
"Fore yeers ago I kudn't spel Engineer.  Now I are won."


<Prev in Thread] Current Thread [Next in Thread>