ident_switch.php - Solve the issue that don't set the good configuration variable for the smtp_host on the latest version + dev of roundcube

This commit is contained in:
Mickael
2022-01-15 21:48:55 +00:00
parent ca790d72de
commit ae7b905824

View File

@@ -179,15 +179,15 @@ class ident_switch extends rcube_plugin
$args['smtp_user'] = $r['username'];
$args['smtp_pass'] = $r['smtp_auth'] == self::SMTP_AUTH_IMAP ? $rc->decrypt($r['password']) : '';
$args['smtp_server'] = $r['smtp_host'] ? $r['smtp_host'] : 'localhost'; // Default SMTP host here
$args['smtp_host'] = $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)
if (strpos($args['smtp_host'], ':') !== false)
self::write_log('SMTP server already contains protocol, ignoring TLS flag.');
else
$args['smtp_server'] = 'tls://' . $args['smtp_server'];
$args['smtp_host'] = 'tls://' . $args['smtp_host'];
}
}