[Mimedefang] Rejecting Some Recipients in filter_recipient() for Relay

imacat imacat at mail.imacat.idv.tw
Sun Mar 25 22:57:27 EDT 2007


Dear all,

On Fri, 23 Mar 2007 23:29:18 +0800
imacat <imacat at mail.imacat.idv.tw> wrote:
> On Fri, 23 Mar 2007 10:14:37 -0400
> Kris Deugau <kdeugau at vianet.ca> wrote:
> > imacat wrote:
> > >     The gateway has rejected the 2 recipients, but it still ask the
> > > intranet mail server for these 2 rejected recipients.  Why?
> > Post your filter_recipient;  it sounds like you're not doing something 
>     My filter_recipient() is attached below.  /etc/mail/local-users is

    Any news on this issue?

> > correctly.  I've used this on several systems without trouble.

    Did you really checked your syslog that the rejected senders really
were not requested to the real back servers?

    I would like it to be true that it is my problem, not of MIMEDefang
or Sendmail.  Submitting bug reports and waiting for an answer and new
version really kills.

    To be simple, I reduced my filter_recipient() to the following, as a
test case, to avoid any problem with other modules like Net::DNS, etc. 
But it is still not working.  Please tell me if it works for someone,
and the rejected recipients has not been forwarded to the real back
servers again in the syslog.

    If it is a MIMEDefang problem, I shall file a bug report to
MIMEDefang.  If it is a Sendmail problem, I shall file a bug report to
Sendmail.

    Thank you very much in advance.

# filter_recipient: Filter by the RCPT_TO: smtp talk
sub filter_recipient {
    my ($recipient, $sender, $ip, $hostname, $first, $helo, $rcpt_mailer,
$rcpt_host, $rcpt_addr) = @_;
    return ("CONTINUE", "ok") if $ip ne "10.0.0.125";
    return ("CONTINUE", "ok") if $recipient eq "<imacat\@pristine.com.tw>";
    return ("REJECT", "User unknown", 550, "5.1.1", 0);
}

    The SMTP talk log is:

220 gate.pristine.com.tw ESMTP Sendmail 8.14.0/8.14.0; Sun, 25 Mar 2007 21:17:49 +0800
EHLO atlas.pristine.com.tw
250-gate.pristine.com.tw Hello atlas.pristine.com.tw [10.0.0.125], pleased to meet you
MAIL FROM:<imacat at pristine.com.tw>
250 2.1.0 <imacat at pristine.com.tw>... Sender ok
RCPT TO:<imacat at pristine.com.tw>
250 2.1.5 <imacat at pristine.com.tw>... Recipient ok
RCPT TO:<asdg232ds at pristine.com.tw>
550 5.1.1 <asdg232ds at pristine.com.tw>... User unknown
RCPT TO:<postmaster at pristine.com.tw>
550 5.1.1 <postmaster at pristine.com.tw>... User unknown
RCPT TO:<tammdiu at pristine.com.tw>
550 5.1.1 <tammdiu at pristine.com.tw>... User unknown
DATA
354 Enter mail, end with "." on a line by itself
From: imacat <imacat at pristine.com.tw>
To: imacat <imacat at pristine.com.tw>
Subject: Testing

Testing
.
250 2.0.0 l2PDHn1s004358 Message accepted for delivery
QUIT
221 2.0.0 gate.pristine.com.tw closing connection

    The related syslog entries are:

Mar 25 21:17:49 gate sendmail[4358]: l2PDHn1s004358: Milter:
to=<asdg232ds at pristine.com.tw>, reject=550 5.1.1 User unknown
Mar 25 21:17:49 gate sendmail[4358]: l2PDHn1s004358: Milter:
to=<postmaster at pristine.com.tw>, reject=550 5.1.1 User unknown
Mar 25 21:17:49 gate sendmail[4358]: l2PDHn1s004358: Milter:
to=<tammdiu at pristine.com.tw>, reject=550 5.1.1 User unknown
Mar 25 21:17:49 gate sendmail[4358]: l2PDHn1s004358:
from=<imacat at pristine.com.tw>, size=103, class=0, nrcpts=4,
msgid=<200703251317.l2PDHn1s004358 at gate.pristine.com.tw>, proto=ESMTP,
daemon=MTA, relay=atlas.pristine.com.tw [10.0.0.125]
Mar 25 21:17:49 gate sendmail[4358]: l2PDHn1s004358: Milter add: header:
X-Scanned-By: MIMEDefang 2.61 on 10.10.0.101
Mar 25 21:17:55 mail sendmail[26750]: l2PDHsrU026750:
<tammdiu at pristine.com.tw>... User unknown
Mar 25 21:17:55 mail sendmail[26750]: l2PDHsrU026750:
<asdg232ds at pristine.com.tw>... User unknown
Mar 25 21:17:55 gate sendmail[4364]: l2PDHn1s004358:
to=<tammdiu at pristine.com.tw>, delay=00:00:06, xdelay=00:00:06,
mailer=relay, pri=210103, relay=mail.pristine.com.tw. [10.0.0.124],
dsn=5.1.1, stat=User unknown
Mar 25 21:17:55 gate sendmail[4364]: l2PDHn1s004358:
to=<asdg232ds at pristine.com.tw>, delay=00:00:06, xdelay=00:00:06,
mailer=relay, pri=210103, relay=mail.pristine.com.tw. [10.0.0.124],
dsn=5.1.1, stat=User unknown
Mar 25 21:17:55 mail sendmail[26750]: l2PDHsrU026750:
from=<imacat at pristine.com.tw>, size=423, class=0, nrcpts=2,
msgid=<200703251317.l2PDHn1s004358 at gate.pristine.com.tw>, proto=ESMTP,
daemon=MTA, relay=gate.pristine.com.tw [10.10.0.101]
Mar 25 21:17:55 gate sendmail[4364]: l2PDHn1s004358:
to=<postmaster at pristine.com.tw>,<imacat at pristine.com.tw>, delay=00:00:06,
xdelay=00:00:06, mailer=relay, pri=210103, relay=mail.pristine.com.tw.
[10.0.0.124], dsn=2.0.0, stat=Sent (l2PDHsrU026750 Message accepted for
delivery)
Mar 25 21:17:55 gate sendmail[4364]: l2PDHn1s004358: l2PDHt1s004364:
DSN: User unknown
Mar 25 21:18:01 mail sendmail[26757]: l2PDHsrU026750: to=imacat,
delay=00:00:06, xdelay=00:00:06, mailer=local, pri=60888, dsn=2.0.0,
stat=Sent




--
Best regards,
imacat ^_*' <imacat at mail.imacat.idv.tw>
PGP Key: http://www.imacat.idv.tw/me/pgpkey.txt

<<Woman's Voice>> News: http://www.wov.idv.tw/
Tavern IMACAT's: http://www.imacat.idv.tw/
TLUG List Manager: http://lists.linux.org.tw/cgi-bin/mailman/listinfo/tlug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <https://lists.mimedefang.org/pipermail/mimedefang_lists.mimedefang.org/attachments/20070326/c0e7dcd8/attachment.sig>


More information about the MIMEDefang mailing list