diff -ru e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl e-smith-email-5.2.0.new/root/usr/local/sbin/smtp-auth-proxy.pl --- e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl 2014-02-10 17:10:03.672061000 -0500 +++ e-smith-email-5.2.0.new/root/usr/local/sbin/smtp-auth-proxy.pl 2014-02-10 16:27:52.198641000 -0500 @@ -119,19 +119,24 @@ foreach my $method (split (/ /, ${*$smtp}{'net_smtp_esmtp'}->{"AUTH"})) { # Skip $method if in the blacklist - next unless ($blacklist !~ /$method/); + if ($blacklist =~ /$method/) + { + warn "Skipping blacklisted method $method\n" if $debug; + next; + } + warn "Trying authentication method $method\n" if $debug; # Only present one auth method at a time to NET::SMTP {${*$smtp}{'net_smtp_esmtp'}->{"AUTH"} = $method;} - if ($smtp->auth($name, $pass)) - { - $authenticated++; - last; - } - else - { - warn "SMTP authentication (with $method) with ISP server failed\n"; - } + eval { $authenticated = $smtp->auth($name, $pass); }; + + if ($@) + { + warn "exception during authentication (with $method): $@\n"; + next; + } + last if $authenticated; + warn "SMTP authentication (with $method) with ISP server failed\n"; } unless ($authenticated) {