[Mimedefang] md_check_against_smtp_server
Kevin A. McGrail
kmcgrail at pccc.com
Wed May 19 13:38:12 EDT 2004
Since I do secondary for some domains, I wanted to check if those servers
are up and otherwise accept the mail for queuing. I'll probably add a hash
to make things easier rather than a REALLY long # of if loops.
sub filter_recipient {
my($recip, $sender, $ip, $host, $first, $helo, $rcpt_mailer, $rcpt_host,
$rcpt_addr) = @_;
my($answer, $explanation);
if ($recip =~ /luselaw.com/i) {
($answer, $explanation) = md_check_against_smtp_server($sender, $recip,
"intel1.peregrinehw.com", "mail.luselaw.com");
if ($answer eq 'TEMPFAIL') {
$answer = 'CONTINUE';
}
return ($answer, $explanation);
}
if ($recip =~ /mmri.com/i) {
($answer, $explanation) = md_check_against_smtp_server($sender, $recip,
"intel1.peregrinehw.com", "mail.mmri.com");
if ($answer eq 'TEMPFAIL') {
$answer = 'CONTINUE';
}
return ($answer, $explanation);
}
... etc ...
return ('CONTINUE', "ok");
}
----- Original Message -----
From: <gord at linvwin.com>
To: <mimedefang at lists.roaringpenguin.com>
Sent: Wednesday, May 19, 2004 12:35 PM
Subject: [Mimedefang] md_check_against_smtp_server
> Hello,
>
> I am using our external mail box to ask our internal server for valid
> users. I have mimedefang doing this now, I am just unsure on how I tell
> mimedefang to reject or tempfail invalid users. I am using the stock
> filter from the man page. Any examples would be very useful.
>
> sub filter_recipient
> {
> my($recip, $sender, $ip, $host, $first, $helo,
> $rcpt_mailer, $rcpt_host, $rcpt_addr) = @_;
> return md_check_against_smtp_server($sender, $recip,
> "external","internal");
> }
>
> I can see the entries in the log asking the internal server for valid
> users and it responding back if they are unknown.
>
> Gord
>
>
> _______________________________________________
> Visit http://www.mimedefang.org and http://www.canit.ca
> MIMEDefang mailing list
> MIMEDefang at lists.roaringpenguin.com
> http://lists.roaringpenguin.com/mailman/listinfo/mimedefang
>
More information about the MIMEDefang
mailing list