From f1bd9679da3000323942b24b59b1d8a1906e0814 Mon Sep 17 00:00:00 2001 From: Boris Gulay Date: Sat, 22 Dec 2018 17:31:58 +0300 Subject: [PATCH] Added SMTP server TLS connection. --- ident_switch.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ident_switch.php b/ident_switch.php index 22491e1..e687f8d 100644 --- a/ident_switch.php +++ b/ident_switch.php @@ -176,6 +176,14 @@ class ident_switch extends rcube_plugin $args['smtp_server'] = $r['smtp_host'] ? $r['smtp_host'] : 'localhost'; // Default SMTP host here $args['smtp_port'] = $r['smtp_port'] ? $r['smtp_port'] : 587; // Default SMTP port here + if ($r['flags'] & self::DB_SECURE_IMAP_TLS) + { + if (strpos($args['smtp_server'], ':') !== false) + self::write_log('SMTP server already contains protocol, ignoring TLS flag.'); + else + $args['smtp_server'] = 'tls://' . $args['smtp_server']; + } + self::write_log(print_r($args, true)); }