[Mimedefang] md_check_against_smtp_server question

Kevin A. McGrail kmcgrail at pccc.com
Thu Apr 1 11:26:05 EST 2004


I believe md_check_against_smtp_server will TEMPFAIL if the server trying to
be queried cannot be reached.  Since I am implementing this on the Backup
MX, I NEED it to queue if it can't be reached.

I was thinking that one parameter could be added to allow for this and I've
worked up the following code for comment:

http://www.peregrinehw.com/downloads/MIMEDefang/contrib/md_check_disable_tempfail_patch

--- mimedefang.pl.in    Wed Mar 24 22:47:58 2004
+++ mimedefang.pl.KAM   Thu Apr  1 11:21:35 2004
@@ -6227,7 +6227,7 @@
 #  HELO / MAIL FROM: / RCPT TO: / QUIT sequence
 #***********************************************************************
 sub md_check_against_smtp_server ($$$$) {
-    my($sender, $recip, $helo, $server) = @_;
+    my($sender, $recip, $helo, $server, $notempfail) = @_;
     my($code, $text, $dsn, $retval);

     # Add angle-brackets if needed
@@ -6243,8 +6243,14 @@
                                     PeerPort => 'smtp(25)',
                                     Proto    => 'tcp',
                                     Timeout  => 15);
+
     if (!defined($sock)) {
-       return ('TEMPFAIL', "Could not connect to other SMTP server: $!");
+        if ($notempfail) {
+            #tempfail disabled - continue regardless
+            return ('CONTINUE', "Accepting Message: TEMPFAIL Disabled &
could not connect to other SMTP server: $!", 250, "2.1.5");
+        } else {
+            return ('TEMPFAIL', "Could not connect to other SMTP server:
$!");
+        }
     }

     ($retval, $code, $dsn, $text) = get_smtp_return_code($sock);
regards,
KAM



More information about the MIMEDefang mailing list