[Mimedefang] md_check_against_smtp_server
Jan Pieter Cornet
johnpc at xs4all.nl
Mon Aug 2 18:02:27 EDT 2004
On Mon, Aug 02, 2004 at 05:41:19PM +1000, Bill Maidment wrote:
> I'm trying to use md_check_against_smtp_server to check the email
> recipient against valid users on another mail server.
>
> The problem I have is that invalid recipients cause the incoming email
> to continually bounce between my two mail servers. Valid recipients work
> fine!
>
> Any clues as to what I've missed/got wrong?
Wild guess: have you enabled filter_recipient processing by running
mimedefang with the "-t" option? (or by specifying MX_RECIPIENT_CHECK="yes"
in the appropriate startup script).
> I have this in sendmail.mc on the other mail server. Could this be the
> cause?
>
> define(`SMART_HOST',`mail.maidment.com.au')
That is only one of the causes, probably. You can use a smarthost,
however.
> mimedefang-filter snippet and email sample follow:
>
> #***********************************************************************
>
>
> sub filter_recipient ($$$$$$$$$) {
> my($recip, $sender, $ip, $host, $first, $helo,
> $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
> return md_check_against_smtp_server($sender, $recip,
> "mail.maidment.com.au",
> "video.maidment.com.au");
> }
You are testing here against the recipient given by the external
relay. I noticed in the headers below that you are actually forwarding
to testing@[192.168.2.5]. You might want to make the same translation
before checking, by adding:
$recip =~ s/\@(mail\.)?maidment\.com\.au/\@[192.168.2.5]/i;
... or something similar.
> >> ----- The following addresses had permanent fatal errors -----
> >><testing@[192.168.2.5]>
> >> (reason: 554 5.4.6 Too many hops)
> >> (expanded from: <testing@[192.168.2.5]>)
> >>
> >> ----- Transcript of session follows -----
> >>554 5.4.6 Too many hops 26 (25 max): from
>
> <SRS0=8uXdd7d2=KY=elgas.com.au=rudy.halim at maidment.com.au> via localhost,
> to <testing@[192.168.2.5]>
>
> >>Reporting-MTA: dns; video.maidment.com.au
> >>Arrival-Date: Mon, 2 Aug 2004 15:13:33 +1000
> >>
> >>Final-Recipient: RFC822; testing@[192.168.2.5]
> >>X-Actual-Recipient: RFC822; testing at mail.maidment.com.au
> >>Action: failed
> >>Status: 5.4.6
> >>Diagnostic-Code: SMTP; 554 5.4.6 Too many hops
> >>Last-Attempt-Date: Mon, 2 Aug 2004 15:15:07 +1000
> >>Return-Path: <SRS0=8uXdd7d2=KY=elgas.com.au=rudy.halim at maidment.com.au>
> >>Received: from mail.maidment.com.au (mail.maidment.com.au [192.168.2.2])
> >> by video.maidment.com.au (8.13.0/8.13.0) with ESMTP id i725DXwF032594
> >> for <testing@[192.168.2.5]>; Mon, 2 Aug 2004 15:13:33 +1000
> >>Received: from video.maidment.com.au (video.maidment.com.au
> [192.168.2.5])
> >> by mail.maidment.com.au (8.13.0/8.13.0) with ESMTP id i725DRBR013005
> >> for <testing at mail.maidment.com.au>; Mon, 2 Aug 2004 15:13:27 +1000
> >>Received: from mail.maidment.com.au (mail.maidment.com.au [192.168.2.2])
> >> by video.maidment.com.au (8.13.0/8.13.0) with ESMTP id i725DV5U032585
> >> for <testing@[192.168.2.5]>; Mon, 2 Aug 2004 15:13:31 +1000
Apparently you are rewriting to USER@[192.168.2.5]. If this works for
known users, then maybe you added those users to something like
virtusertable? If so, maybe you forgot to add the catch-all entry at the
end of virtusertable, saying:
@[192.168.2.5] error:"5.1.1" No such user
--
#!perl -wpl # mmfppfmpmmpp mmpffm <pmmppfmfpppppfmmmf at fpffmm4mmmpmfpmf.ppppmf>
$p=3-2*/[^\W\dmpf_]/i;s.[a-z]{$p}.vec($f=join('',$p-1?chr(sub{$_[0]*9+$_[1]*3+
$_[2]}->(map{/p|f/i+/f/i}split//,$&)+97):qw(m p f)[map{((ord$&)%32-1)/$_%3}(9,
3,1)]),5,1)='`'lt$&;$f.eig; # Jan-Pieter Cornet
More information about the MIMEDefang
mailing list