1 |
wellsi |
1.1 |
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 |
2 |
|
|
--- e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl 2014-02-10 17:10:03.672061000 -0500 |
3 |
|
|
+++ e-smith-email-5.2.0.new/root/usr/local/sbin/smtp-auth-proxy.pl 2014-02-10 16:27:52.198641000 -0500 |
4 |
|
|
@@ -119,19 +119,24 @@ |
5 |
|
|
foreach my $method (split (/ /, ${*$smtp}{'net_smtp_esmtp'}->{"AUTH"})) |
6 |
|
|
{ |
7 |
|
|
# Skip $method if in the blacklist |
8 |
|
|
- next unless ($blacklist !~ /$method/); |
9 |
|
|
+ if ($blacklist =~ /$method/) |
10 |
|
|
+ { |
11 |
|
|
+ warn "Skipping blacklisted method $method\n" if $debug; |
12 |
|
|
+ next; |
13 |
|
|
+ } |
14 |
|
|
+ warn "Trying authentication method $method\n" if $debug; |
15 |
|
|
# Only present one auth method at a time to NET::SMTP |
16 |
|
|
{${*$smtp}{'net_smtp_esmtp'}->{"AUTH"} = $method;} |
17 |
|
|
|
18 |
|
|
- if ($smtp->auth($name, $pass)) |
19 |
|
|
- { |
20 |
|
|
- $authenticated++; |
21 |
|
|
- last; |
22 |
|
|
- } |
23 |
|
|
- else |
24 |
|
|
- { |
25 |
|
|
- warn "SMTP authentication (with $method) with ISP server failed\n"; |
26 |
|
|
- } |
27 |
|
|
+ eval { $authenticated = $smtp->auth($name, $pass); }; |
28 |
|
|
+ |
29 |
|
|
+ if ($@) |
30 |
|
|
+ { |
31 |
|
|
+ warn "exception during authentication (with $method): $@\n"; |
32 |
|
|
+ next; |
33 |
|
|
+ } |
34 |
|
|
+ last if $authenticated; |
35 |
|
|
+ warn "SMTP authentication (with $method) with ISP server failed\n"; |
36 |
|
|
} |
37 |
|
|
unless ($authenticated) |
38 |
|
|
{ |