procmail
[Top] [All Lists]

procmail on a sendmail gateway with aliases

2005-01-16 21:27:43
Thank you all for your time in advance.

I administer the email system for "madeup.com".
I have the following setup.


INTERNET
  V
mx.madeup.com (incoming only mail gateway - Sendmail 8.11.7p1+Sun/8.11.6)
  V
msexchange.madeup.com (sends outgoing mail directly)---->INTERNET


As a basic protection for exchange I have all valid users on the
exchange server listed in the /etc/mail/aliases file with entries such
as these.

username: username(_at_)msexchange(_dot_)madeup(_dot_)com


I wish to use procmail on this mail server to do some filtering on the
mail flowing through it before it reaches the exchange server. Here is
what I want to happen:

1) Mail arrives at mx.madeup.com. 
2) the aliases file is looked at and if the recipient is not in there
the message is discarded.
3) other recipies are processed (possibly spamassasin)
4) message is forwarded.

How can i do this? I am a little confused on when the aliases file
gets consulted.

I have the following in my procmailrc file

:0fw:spamassassin.lock
* < 256000
| /usr/local/bin/spamc

:0 w
! -oi -f "$@"

and I built my sendmail.cf using this mc file

VERSIONID(`@(#)subsidiary-v7sun.mc      1.8 (Sun) 09/12/01')
OSTYPE(`solaris8')dnl
DOMAIN(`solaris-generic')dnl
FEATURE(`remote_mode')dnl
FEATURE(`access_db')dnl
FEATURE(`blacklist_recipients')dnl
define(`PROCMAIL_MAILER_ARGS', `procmail -m $h $g $u')dnl
define(`PROCMAIL_MAILER_FLAGS', `mSDFMhun')dnl
define(`PROCMAIL_MAILER_PATH',`/usr/local/procmail/bin/procmail')dnl
define(`SMART_HOST', `mailhost$?m.$m$.')dnl
MAILER(`local')dnl
MAILER(`smtp')dnl
MAILER(`procmail')dnl
LOCAL_CONFIG
CPprocmail
LOCAL_RULESETS
LOCAL_RULE_0
R$* < @ $=w > $*        $#procmail $@ /etc/mail/procmailrc $:
$1<@$2.procmail.>$3
R$* < @ $=w. > $*       $#procmail $@ /etc/mail/procmailrc $:
$1<@$2.procmail.>$3
R$* < @ $=R > $*        $#procmail $@ /etc/mail/procmailrc $:
$1<@$2.procmail.>$3
R$* < @ $=R. > $*       $#procmail $@ /etc/mail/procmailrc $:
$1<@$2.procmail.>$3
R$* < @$* .procmail. > $*       $1<@$2.>$3      Already filtered, map
to original address


It appears that spamassassin is scanning all incoming mail. I do not
want that. I want stuff coming in from dictionary attackers to be
discarded at the outset (based on the aliases file) before the
spamassassin recipe does it's work.

Also with the above setup I keep getting some errors in my
/var/log/syslog that I am curious about.

Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=ssiedduzat(_at_)madeup(_dot_)com(_dot_)procmail, 
delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=stubbleward(_at_)madeup(_dot_)com(_dot_)procmail, 
delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=cole(_at_)madeup(_dot_)com(_dot_)procmail, delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=gregory(_at_)madeup(_dot_)com(_dot_)procmail, delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=spiceupgirl(_at_)madeup(_dot_)com(_dot_)procmail, 
delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Jan 14 16:02:49 dds1 sendmail[4515]: [ID 801593 mail.info]
j0EL2ns04515: to=spursstadium(_at_)madeup(_dot_)com(_dot_)procmail, 
delay=00:00:00,
mailer=local, pri=0, dsn=5.1.1, stat=User unknow
n
...
Jan 14 16:02:49 dds1 sendmail[4511]: [ID 801593 mail.info]
j0EL2fc04509: 
to=<ssiedduzat(_at_)madeup(_dot_)com>,<stubbleward(_at_)madeup(_dot_)com>,<cole(_at_)madeup(_dot_)com>,<gregory(_at_)madeup(_dot_)com>,<spiceupgirl@
madeup.com>,<spursstadium(_at_)madeup(_dot_)com>,<tak610317(_at_)madeup(_dot_)com>,<stevenbarrick(_at_)madeup(_dot_)com>,
delay=00:00:07, xdelay=00:00:01, mailer=procmail, pri=334275,
relay=/etc/mail/procmailrc
, dsn=5.0.0, stat=Can't create output
Jan 14 16:02:49 dds1 sendmail[4511]: [ID 801593 mail.info]
j0EL2fc04509: j0EL2nc04511: DSN: Can't create output


and these in my procmail log

procmail: Program failure (67) of "/usr/lib/sendmail"
 Subject: Upgragde your laptop?  Get Sony Vaio W700G for free
  Folder: **Bounced**                                                      5783


I would appreciate any help on this.

____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>
  • procmail on a sendmail gateway with aliases, LLCool Jay <=