1 |
diff -ruN e-smith-email-5.2.0.old/root/usr/local/sbin/smtp-auth-proxy.pl e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl |
2 |
--- e-smith-email-5.2.0.old/root/usr/local/sbin/smtp-auth-proxy.pl 2012-12-20 03:05:41.000000000 +0000 |
3 |
+++ e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl 2012-12-20 03:19:59.000000000 +0000 |
4 |
@@ -91,6 +91,27 @@ |
5 |
|
6 |
my @ehlo = $smtp->message; |
7 |
|
8 |
+ if (grep { /STARTTLS$/ } @ehlo) |
9 |
+ { |
10 |
+ $smtp->command('STARTTLS'); |
11 |
+ my $response = $smtp->response; |
12 |
+ my $status = $smtp->message; |
13 |
+ use IO::Socket::SSL; |
14 |
+ my $sslret = IO::Socket::SSL->start_SSL( |
15 |
+ $smtp, |
16 |
+ Timeout => 30, |
17 |
+ SSL_startHandshake => 1 |
18 |
+ ); |
19 |
+ unless ($sslret) { |
20 |
+ my $error = IO::Socket::SSL::errstr(); |
21 |
+ print("454 TLS not available due to temporary reason [$error]"); |
22 |
+ } |
23 |
+ bless $smtp, 'Net::SMTP::SSL'; |
24 |
+ $smtp->reset; |
25 |
+ $smtp->hello("${system_name}.${domain_name}"); |
26 |
+ @ehlo = $smtp->message; |
27 |
+ } |
28 |
+ |
29 |
if ($smtp->supports("AUTH")) |
30 |
{ |
31 |
foreach (split (/ /, $self->get_property('Blacklist'))) |