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 --- e-smith-email-5.2.0.old/root/usr/local/sbin/smtp-auth-proxy.pl 2012-12-20 03:05:41.000000000 +0000 +++ e-smith-email-5.2.0/root/usr/local/sbin/smtp-auth-proxy.pl 2012-12-20 03:19:59.000000000 +0000 @@ -91,6 +91,27 @@ my @ehlo = $smtp->message; + if (grep { /STARTTLS$/ } @ehlo) + { + $smtp->command('STARTTLS'); + my $response = $smtp->response; + my $status = $smtp->message; + use IO::Socket::SSL; + my $sslret = IO::Socket::SSL->start_SSL( + $smtp, + Timeout => 30, + SSL_startHandshake => 1 + ); + unless ($sslret) { + my $error = IO::Socket::SSL::errstr(); + print("454 TLS not available due to temporary reason [$error]"); + } + bless $smtp, 'Net::SMTP::SSL'; + $smtp->reset; + $smtp->hello("${system_name}.${domain_name}"); + @ehlo = $smtp->message; + } + if ($smtp->supports("AUTH")) { foreach (split (/ /, $self->get_property('Blacklist')))