Subject: | patch to give error message when server drops connection |
If the mail server closes the connection immediately after the
connection is made (probably a malfunctioning mail server), Mail::Sender
gives the error "Service not available. Reply:" as there is no reply.
This error is improved by the supplied patch to read "Service not
available. Server closed connection unexpectedly" if there is no reply
from the email server
Subject: | server_closed_connection.patch |
diff -Naur old/Config new/Config
--- old/Config 1970-01-01 10:00:00.000000000 +1000
+++ new/Config 2009-02-13 10:44:52.000000000 +1100
@@ -0,0 +1 @@
+
diff -Naur old/Sender.pm new/Sender.pm
--- old/Sender.pm 2008-07-15 06:44:08.000000000 +1000
+++ new/Sender.pm 2009-02-13 11:36:12.000000000 +1100
@@ -361,7 +361,7 @@
sub SERVNOTAVAIL {
$!=40;
- $Mail::Sender::Error="Service not available. Reply: $_[0]";
+ $Mail::Sender::Error="Service not available. " . ($_[0] ? "Reply: $_[0]" : "Server closed connection unexpectedly");
return -4, $Mail::Sender::Error;
}