On 11/1/06, Kanda Nikornpongsin <thaichili(_at_)hotmail(_dot_)com> wrote:
Hi Matt,
Thanks for your response. So from what I understand procmail rule process
mails in qmail-queue that are detined for local delivery. I would like to
still have my /etc/tcp.smtp config as below, so that mails are not rejected.
127.:allow,RELAYCLIENT=""
172.26.:allow,RELAYCLIENT=""
tcpserver will consult /etc/tcp.smtp when accepting a connection. If
it passes the rules, then it will pass the connection on down the
program stack (usually to smtpd).
But once qmail looks up my rcptphost and see it is not for local mails I
would like it to drop instead of RELAY
Perhaps another word can I apply procmail rule to qmail-smtp?
Can I do something like this
tcpserver -c100 -x/etc/tcp.smtp.cdb 0 smtp /var/qmail/bin/qmail-smtpd '|
preline /bin/procmail /etc/procmalrc' /var/qmail/bin/splogger smtpd &
where my /etc/procmailrc list as below
I wouldn't add it to the stack, but that may be possible. Since
someone has written an rc file for procmail, I'd use that way instead.
VERBOSE=yes
PATH=/bin:/usr/bin:/opt/bin:/usr/local/bin
LOGABSTRACT=all
COMSAT=no
SHELL=/bin/sh
MAILDIR=$HOME/Maildir/
LOGFILE=/tmp/procmail.log
:0
* !^To:.*(mydomain\.com)
* !^Cc:.*(mydomain\.com)
* !^^X-From: mydomain
{
LOG = "!mydomain"
:0
/dev/null/
}
I don't believe that recipe does what you want. You want something
more like this:
:0
* !^(To|Cc|X-From):.*mydomain
problemhost/
But instead of checking the To or Cc headers, I'd look at the
Received: headers to filter out your problem host.
Regardless, I'd filter the rejected mails into a mailbox which you can
examine (not /dev/null). You may run into some false positives. And
you can always delete them later.
--
-- Matt Dunford -- zenmatic(_at_)gmail(_dot_)com
____________________________________________________________
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