Replace TLS checkbox with security dropdown (None/STARTTLS/SSL)

Replace the single IMAP TLS checkbox with a per-protocol security
dropdown for IMAP, SMTP, and Sieve. The security scheme (ssl:// or
tls://) is now stored directly in the host field, unifying the approach
across all protocols.

Smart form behavior:
- Default ports update automatically when changing security type
- Fields clear on blur when value matches the placeholder
- Warning shown when selecting no encryption
- Defaults: IMAP SSL/993, SMTP STARTTLS/587, Sieve STARTTLS/4190

The DB_SECURE_IMAP_TLS flag is no longer written but still read for
backward compatibility with existing records.
This commit is contained in:
Laurent Dinclaux
2026-02-10 17:54:36 +11:00
parent 780cfc6a7e
commit 36b9b3e35f
11 changed files with 368 additions and 133 deletions

View File

@@ -2,6 +2,7 @@
* ident_switch - Identity settings form handler. * ident_switch - Identity settings form handler.
* *
* Copyright (C) 2018 Boris Gulay * Copyright (C) 2018 Boris Gulay
* Copyright (C) 2026 Gecka
* *
* Original code licensed under GPL-3.0+. * Original code licensed under GPL-3.0+.
* New contributions licensed under AGPL-3.0+. * New contributions licensed under AGPL-3.0+.
@@ -9,11 +10,95 @@
* @url https://github.com/Gecka-apps/ident_switch * @url https://github.com/Gecka-apps/ident_switch
*/ */
/**
* Default ports per protocol and security type.
*/
var ident_switch_portDefaults = {
imap: { '': 143, tls: 143, ssl: 993 },
smtp: { '': 25, tls: 587, ssl: 465 },
sieve: { '': 4190, tls: 4190, ssl: 4190 }
};
$(function() { $(function() {
$("INPUT[name='_ident_switch.form.common.enabled']").change(); $("INPUT[name='_ident_switch.form.common.enabled']").change();
plugin_switchIdent_processPreconfig(); plugin_switchIdent_processPreconfig();
// Bind security change handlers
$.each(['imap', 'smtp', 'sieve'], function(i, proto) {
var secSel = "SELECT[name='_ident_switch.form." + proto + ".security']";
$(secSel).on('change', function() {
plugin_switchIdent_onSecurityChange(proto, $(this).val());
});
});
// Bind blur handlers for smart placeholder clearing
$.each(['imap', 'smtp', 'sieve'], function(i, proto) {
var portFld = $("INPUT[name='_ident_switch.form." + proto + ".port']");
portFld.on('blur', function() {
plugin_switchIdent_clearIfDefault($(this));
});
var hostFld = $("INPUT[name='_ident_switch.form." + proto + ".host']");
hostFld.on('blur', function() {
plugin_switchIdent_clearIfDefault($(this));
});
});
// Delimiter blur handler
$("INPUT[name='_ident_switch.form.imap.delimiter']").on('blur', function() {
plugin_switchIdent_clearIfDefault($(this));
});
}); });
/**
* Handle security dropdown change: update port placeholder and show/hide warning.
* @param {string} proto - Protocol name (imap, smtp, sieve).
* @param {string} security - Selected security value ('', 'tls', 'ssl').
*/
function plugin_switchIdent_onSecurityChange(proto, security) {
var portFld = $("INPUT[name='_ident_switch.form." + proto + ".port']");
var defaults = ident_switch_portDefaults[proto];
// Check if port value matches any known default for this protocol
var portVal = portFld.val();
var isDefault = !portVal;
if (portVal) {
$.each(defaults, function(_, v) {
if (parseInt(portVal) === v) {
isDefault = true;
return false;
}
});
}
// Update placeholder to new default
var newDefault = defaults[security] || defaults[''];
portFld.attr('placeholder', newDefault);
// If port was empty or matched a known default, clear it
if (isDefault) {
portFld.val('');
}
// Show/hide security warning
var warningId = '#ident-switch-security-warning-' + proto;
if (security === '') {
$(warningId).show();
} else {
$(warningId).hide();
}
}
/**
* On blur: clear field if value matches its placeholder.
* @param {jQuery} $field - The input field.
*/
function plugin_switchIdent_clearIfDefault($field) {
var val = $.trim($field.val());
var placeholder = $field.attr('placeholder') || '';
if (val !== '' && val === String(placeholder)) {
$field.val('');
}
}
function plugin_switchIdent_processPreconfig() { function plugin_switchIdent_processPreconfig() {
var disFld = $("INPUT[name='_ident_switch.form.common.readonly']"); var disFld = $("INPUT[name='_ident_switch.form.common.readonly']");
disFld.parentsUntil("TABLE", "TR").hide(); disFld.parentsUntil("TABLE", "TR").hide();
@@ -21,23 +106,27 @@ function plugin_switchIdent_processPreconfig() {
var disVal = disFld.val(); var disVal = disFld.val();
if (disVal > 0) { if (disVal > 0) {
$("INPUT[name='_ident_switch.form.imap.host']").prop("disabled", true); $("INPUT[name='_ident_switch.form.imap.host']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.imap.tls']").prop("disabled", true); $("SELECT[name='_ident_switch.form.imap.security']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.imap.port']").prop("disabled", true); $("INPUT[name='_ident_switch.form.imap.port']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.smtp.host']").prop("disabled", true); $("INPUT[name='_ident_switch.form.smtp.host']").prop("disabled", true);
$("SELECT[name='_ident_switch.form.smtp.security']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.smtp.port']").prop("disabled", true); $("INPUT[name='_ident_switch.form.smtp.port']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.sieve.host']").prop("disabled", true); $("INPUT[name='_ident_switch.form.sieve.host']").prop("disabled", true);
$("SELECT[name='_ident_switch.form.sieve.security']").prop("disabled", true);
$("INPUT[name='_ident_switch.form.sieve.port']").prop("disabled", true); $("INPUT[name='_ident_switch.form.sieve.port']").prop("disabled", true);
} }
if (2 == disVal) { if (2 == disVal) {
$("INPUT[name='_ident_switch.form.imap.username']").prop("disabled", true); $("INPUT[name='_ident_switch.form.imap.username']").prop("disabled", true);
} }
} }
function plugin_switchIdent_enabled_onChange(e) { function plugin_switchIdent_enabled_onChange(e) {
var $enFld = $("INPUT[name='_ident_switch.form.common.enabled'], INPUT[name='_ident_switch.form.imap.host'], INPUT[name='_ident_switch.form.smtp.host']"); var $enFld = $("INPUT[name='_ident_switch.form.common.enabled'], INPUT[name='_ident_switch.form.imap.host'], INPUT[name='_ident_switch.form.smtp.host']");
$("INPUT[name!='_ident_switch.form.common.enabled']", $enFld.parents("FIELDSET")).prop("disabled", !$enFld.is(":checked")); var $fieldset = $enFld.parents("FIELDSET");
var isEnabled = $enFld.is(":checked");
$("INPUT[name!='_ident_switch.form.common.enabled']", $fieldset).prop("disabled", !isEnabled);
$("SELECT", $fieldset).prop("disabled", !isEnabled);
plugin_switchIdent_processPreconfig(); plugin_switchIdent_processPreconfig();
} }

View File

@@ -43,15 +43,15 @@ class IdentSwitchForm
* Build the IMAP form fields for identity settings. * Build the IMAP form fields for identity settings.
* *
* @param array $record Identity record data used for placeholders. * @param array $record Identity record data used for placeholders.
* @return array Form field definitions for IMAP host, port, TLS, username, password, delimiter. * @return array Form field definitions for IMAP host, port, security, username, password, delimiter.
*/ */
public static function get_imap_fields(array &$record): array public function get_imap_fields(array &$record): array
{ {
$prefix = 'ident_switch.form.imap.'; $prefix = 'ident_switch.form.imap.';
return [ return [
$prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'], $prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'],
$prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 143], $prefix . 'security' => ['value' => $this->build_security_select($prefix, $record, 'ssl')],
$prefix . 'tls' => ['type' => 'checkbox'], $prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 993],
$prefix . 'username' => ['type' => 'text', 'size' => 64, 'placeholder' => $record['email'] ?? ''], $prefix . 'username' => ['type' => 'text', 'size' => 64, 'placeholder' => $record['email'] ?? ''],
$prefix . 'password' => ['type' => 'password', 'size' => 64], $prefix . 'password' => ['type' => 'password', 'size' => 64],
$prefix . 'delimiter' => ['type' => 'text', 'size' => 1, 'placeholder' => 'Auto'], $prefix . 'delimiter' => ['type' => 'text', 'size' => 1, 'placeholder' => 'Auto'],
@@ -74,6 +74,7 @@ class IdentSwitchForm
return [ return [
$prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'], $prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'],
$prefix . 'security' => ['value' => $this->build_security_select($prefix, $record, 'tls')],
$prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 587], $prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 587],
$prefix . 'auth' => ['value' => $authType->show([$record['ident_switch.form.smtp.auth'] ?? null])], $prefix . 'auth' => ['value' => $authType->show([$record['ident_switch.form.smtp.auth'] ?? null])],
]; ];
@@ -95,6 +96,7 @@ class IdentSwitchForm
return [ return [
$prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'], $prefix . 'host' => ['type' => 'text', 'size' => 64, 'placeholder' => 'localhost'],
$prefix . 'security' => ['value' => $this->build_security_select($prefix, $record, 'tls')],
$prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 4190], $prefix . 'port' => ['type' => 'text', 'size' => 5, 'placeholder' => 4190],
$prefix . 'auth' => ['value' => $authType->show([$record['ident_switch.form.sieve.auth'] ?? null])], $prefix . 'auth' => ['value' => $authType->show([$record['ident_switch.form.sieve.auth'] ?? null])],
]; ];
@@ -142,6 +144,67 @@ class IdentSwitchForm
]; ];
} }
/**
* Build a security dropdown select for a protocol section.
*
* @param string $prefix Form field prefix (e.g. 'ident_switch.form.imap.').
* @param array $record Identity record data.
* @param string $default Default security value ('', 'tls', 'ssl').
* @return string Rendered HTML select element.
*/
private function build_security_select(string $prefix, array &$record, string $default): string
{
$select = new html_select(['name' => "_{$prefix}security"]);
$select->add($this->plugin->gettext('form.security.none'), '');
$select->add($this->plugin->gettext('form.security.starttls'), 'tls');
$select->add($this->plugin->gettext('form.security.ssl'), 'ssl');
$current = $record[$prefix . 'security'] ?? $default;
$proto = str_replace('ident_switch.form.', '', rtrim($prefix, '.'));
$hidden = $current !== '' ? ' style="display:none"' : '';
$warning = '<div id="ident-switch-security-warning-' . $proto . '" class="boxwarning"' . $hidden . '>'
. rcube::Q($this->plugin->gettext('form.security.none_warning'))
. '</div>';
return $select->show($current) . $warning;
}
/**
* Parse scheme prefix from a host string.
*
* @param string $host Host string, optionally prefixed with ssl:// or tls://.
* @return array{scheme: string, host: string} Parsed scheme and bare host.
*/
private static function parse_host_scheme(string $host): array
{
$lower = strtolower($host);
if (str_starts_with($lower, 'ssl://')) {
return ['scheme' => 'ssl', 'host' => substr($host, 6)];
}
if (str_starts_with($lower, 'tls://')) {
return ['scheme' => 'tls', 'host' => substr($host, 6)];
}
return ['scheme' => '', 'host' => $host];
}
/**
* Compose a host string with scheme prefix.
*
* @param string|null $host Bare host name.
* @param string|null $security Security type ('', 'tls', 'ssl').
* @return string|null Host with scheme prefix, or null if host is empty.
*/
private static function compose_host_scheme(?string $host, ?string $security): ?string
{
if ($host === null || $host === '') {
return $host;
}
if ($security === 'ssl' || $security === 'tls') {
return $security . '://' . $host;
}
return $host;
}
/** /**
* Handle identity_form hook: add plugin-specific fields to the identity editor. * Handle identity_form hook: add plugin-specific fields to the identity editor.
* *
@@ -205,7 +268,22 @@ class IdentSwitchForm
// Parse flags // Parse flags
$record['ident_switch.form.common.enabled'] = (bool)($row['flags'] & ident_switch::DB_ENABLED); $record['ident_switch.form.common.enabled'] = (bool)($row['flags'] & ident_switch::DB_ENABLED);
$record['ident_switch.form.imap.tls'] = (bool)($row['flags'] & ident_switch::DB_SECURE_IMAP_TLS);
// Parse host schemes into separate security fields
foreach (['imap', 'smtp', 'sieve'] as $proto) {
$key = "ident_switch.form.{$proto}.host";
$hostVal = $record[$key] ?? '';
if ($hostVal !== '') {
$parsed = self::parse_host_scheme($hostVal);
$record[$key] = $parsed['host'];
$record["ident_switch.form.{$proto}.security"] = $parsed['scheme'];
}
}
// Backward compat: if IMAP host had no scheme but TLS flag was set
if (empty($record['ident_switch.form.imap.security']) && ($row['flags'] & ident_switch::DB_SECURE_IMAP_TLS)) {
$record['ident_switch.form.imap.security'] = 'tls';
}
// Set readonly if needed // Set readonly if needed
$cfg = $preconfig->get($record['email']); $cfg = $preconfig->get($record['email']);
@@ -225,7 +303,7 @@ class IdentSwitchForm
]; ];
$args['form']['ident_switch.imap'] = [ $args['form']['ident_switch.imap'] = [
'name' => $this->plugin->gettext('form.imap.caption'), 'name' => $this->plugin->gettext('form.imap.caption'),
'content' => self::get_imap_fields($record), 'content' => $this->get_imap_fields($record),
]; ];
$args['form']['ident_switch.smtp'] = [ $args['form']['ident_switch.smtp'] = [
'name' => $this->plugin->gettext('form.smtp.caption'), 'name' => $this->plugin->gettext('form.smtp.caption'),
@@ -414,11 +492,6 @@ class IdentSwitchForm
$data[$dataKey] = $record[$recordKey]; $data[$dataKey] = $record[$recordKey];
} }
} }
// Handle TLS flag from preconfig
if (!empty($record['ident_switch.form.imap.tls'])) {
$data['flags'] |= ident_switch::DB_SECURE_IMAP_TLS;
}
} }
/** /**
@@ -439,7 +512,10 @@ class IdentSwitchForm
return $retVal; return $retVal;
} }
// Validate and compose IMAP host with security scheme
$retVal['imap.host'] = self::get_field_value('imap', 'host'); $retVal['imap.host'] = self::get_field_value('imap', 'host');
$imapSecurity = self::get_field_value('imap', 'security') ?? '';
$retVal['imap.host'] = self::compose_host_scheme($retVal['imap.host'], $imapSecurity);
if (strlen($retVal['imap.host'] ?? '') > 64) { if (strlen($retVal['imap.host'] ?? '') > 64) {
$retVal['err'] = 'host.long'; $retVal['err'] = 'host.long';
return $retVal; return $retVal;
@@ -467,7 +543,10 @@ class IdentSwitchForm
return $retVal; return $retVal;
} }
// Validate and compose SMTP host with security scheme
$retVal['smtp.host'] = self::get_field_value('smtp', 'host'); $retVal['smtp.host'] = self::get_field_value('smtp', 'host');
$smtpSecurity = self::get_field_value('smtp', 'security') ?? '';
$retVal['smtp.host'] = self::compose_host_scheme($retVal['smtp.host'], $smtpSecurity);
if (strlen($retVal['smtp.host'] ?? '') > 64) { if (strlen($retVal['smtp.host'] ?? '') > 64) {
$retVal['err'] = 'host.long'; $retVal['err'] = 'host.long';
return $retVal; return $retVal;
@@ -489,7 +568,10 @@ class IdentSwitchForm
return $retVal; return $retVal;
} }
// Validate and compose Sieve host with security scheme
$retVal['sieve.host'] = self::get_field_value('sieve', 'host'); $retVal['sieve.host'] = self::get_field_value('sieve', 'host');
$sieveSecurity = self::get_field_value('sieve', 'security') ?? '';
$retVal['sieve.host'] = self::compose_host_scheme($retVal['sieve.host'], $sieveSecurity);
if (strlen($retVal['sieve.host'] ?? '') > 64) { if (strlen($retVal['sieve.host'] ?? '') > 64) {
$retVal['err'] = 'host.long'; $retVal['err'] = 'host.long';
return $retVal; return $retVal;
@@ -526,14 +608,9 @@ class IdentSwitchForm
// Get also password // Get also password
$retVal['imap.pass'] = self::get_field_value('imap', 'password', false, true); $retVal['imap.pass'] = self::get_field_value('imap', 'password', false, true);
// Parse secure settings // Flags: only enabled, security is now in host field scheme
$retVal['flags'] = ident_switch::DB_ENABLED; $retVal['flags'] = ident_switch::DB_ENABLED;
$tls = self::get_field_value('imap', 'tls', false);
if ($tls) {
$retVal['flags'] |= ident_switch::DB_SECURE_IMAP_TLS;
}
return $retVal; return $retVal;
} }

View File

@@ -73,57 +73,24 @@ class IdentSwitchPreconfig
if (is_array($cfg)) { if (is_array($cfg)) {
ident_switch::write_log("Applying predefined configuration for '{$email}'."); ident_switch::write_log("Applying predefined configuration for '{$email}'.");
// IMAP: use imap_host, fallback to host // Parse each protocol URL into host, security, and port
$imapUrl = $cfg['imap_host'] ?? $cfg['host'] ?? ''; $protocols = [
if (!empty($imapUrl)) { 'imap' => $cfg['imap_host'] ?? $cfg['host'] ?? '',
$urlArr = parse_url($imapUrl); 'smtp' => $cfg['smtp_host'] ?? $cfg['host'] ?? '',
'sieve' => $cfg['sieve_host'] ?? '',
];
foreach ($protocols as $proto => $url) {
if (empty($url)) {
continue;
}
$urlArr = parse_url($url);
$host = !empty($urlArr['host']) ? rcube::Q($urlArr['host'], 'url') : ''; $host = !empty($urlArr['host']) ? rcube::Q($urlArr['host'], 'url') : '';
$scheme = strtolower($urlArr['scheme'] ?? ''); $scheme = strtolower($urlArr['scheme'] ?? '');
if ($scheme === 'ssl') { $record["ident_switch.form.{$proto}.host"] = $host;
$record['ident_switch.form.imap.host'] = 'ssl://' . $host; $record["ident_switch.form.{$proto}.security"] = in_array($scheme, ['ssl', 'tls']) ? $scheme : '';
$record['ident_switch.form.imap.tls'] = false; $record["ident_switch.form.{$proto}.port"] = !empty($urlArr['port']) ? intval($urlArr['port']) : '';
} elseif ($scheme === 'tls') {
$record['ident_switch.form.imap.host'] = $host;
$record['ident_switch.form.imap.tls'] = true;
} else {
$record['ident_switch.form.imap.host'] = $host;
$record['ident_switch.form.imap.tls'] = false;
}
$record['ident_switch.form.imap.port'] = !empty($urlArr['port']) ? intval($urlArr['port']) : '';
}
// SMTP: use smtp_host, fallback to host
$smtpUrl = $cfg['smtp_host'] ?? $cfg['host'] ?? '';
if (!empty($smtpUrl)) {
$urlArr = parse_url($smtpUrl);
$host = !empty($urlArr['host']) ? rcube::Q($urlArr['host'], 'url') : '';
$scheme = strtolower($urlArr['scheme'] ?? '');
if ($scheme === 'tls' || $scheme === 'ssl') {
$record['ident_switch.form.smtp.host'] = $scheme . '://' . $host;
} else {
$record['ident_switch.form.smtp.host'] = $host;
}
$record['ident_switch.form.smtp.port'] = !empty($urlArr['port']) ? intval($urlArr['port']) : '';
}
// Sieve: use sieve_host only (no fallback — sieve is optional)
$sieveUrl = $cfg['sieve_host'] ?? '';
if (!empty($sieveUrl)) {
$urlArr = parse_url($sieveUrl);
$host = !empty($urlArr['host']) ? rcube::Q($urlArr['host'], 'url') : '';
$scheme = strtolower($urlArr['scheme'] ?? '');
if ($scheme === 'tls' || $scheme === 'ssl') {
$record['ident_switch.form.sieve.host'] = $scheme . '://' . $host;
} else {
$record['ident_switch.form.sieve.host'] = $host;
}
$record['ident_switch.form.sieve.port'] = !empty($urlArr['port']) ? intval($urlArr['port']) : '';
} }
$loginSet = false; $loginSet = false;

View File

@@ -95,18 +95,24 @@ class IdentSwitchSwitcher
} }
} }
$def_port = 143;
$ssl = null;
if ($r['flags'] & ident_switch::DB_SECURE_IMAP_TLS) {
$ssl = 'tls';
}
$port = $r['imap_port'] ?: $def_port;
$host = $r['imap_host'] ?: 'localhost'; $host = $r['imap_host'] ?: 'localhost';
if ($ssl && !str_starts_with(strtolower($host), "{$ssl}://")) { $ssl = null;
$host = "{$ssl}://" . $host;
// Parse scheme from host field
$hostLower = strtolower($host);
if (str_starts_with($hostLower, 'ssl://')) {
$ssl = 'ssl';
} elseif (str_starts_with($hostLower, 'tls://')) {
$ssl = 'tls';
} elseif ($r['flags'] & ident_switch::DB_SECURE_IMAP_TLS) {
// Backward compat: old records without scheme in host
$ssl = 'tls';
$host = 'tls://' . $host;
} }
$def_port = ($ssl === 'ssl') ? 993 : 143;
$port = $r['imap_port'] ?: $def_port;
$delimiter = $r['imap_delimiter'] ?: null; $delimiter = $r['imap_delimiter'] ?: null;
$_SESSION['storage_host'] = $host; $_SESSION['storage_host'] = $host;
@@ -164,7 +170,7 @@ class IdentSwitchSwitcher
$rc = rcmail::get_instance(); $rc = rcmail::get_instance();
$sql = 'SELECT smtp_host, flags, smtp_port, username, smtp_auth, password FROM ' . $rc->db->table_name(ident_switch::TABLE) . ' WHERE iid = ? AND user_id = ?'; $sql = 'SELECT smtp_host, smtp_port, username, smtp_auth, password FROM ' . $rc->db->table_name(ident_switch::TABLE) . ' WHERE iid = ? AND user_id = ?';
$q = $rc->db->query($sql, $iid, $rc->user->ID); $q = $rc->db->query($sql, $iid, $rc->user->ID);
$r = $rc->db->fetch_assoc($q); $r = $rc->db->fetch_assoc($q);
if (is_array($r)) { if (is_array($r)) {
@@ -179,17 +185,8 @@ class IdentSwitchSwitcher
$args['smtp_user'] = $r['username']; $args['smtp_user'] = $r['username'];
$args['smtp_pass'] = $r['smtp_auth'] == ident_switch::SMTP_AUTH_IMAP ? $rc->decrypt($r['password']) : ''; $args['smtp_pass'] = $r['smtp_auth'] == ident_switch::SMTP_AUTH_IMAP ? $rc->decrypt($r['password']) : '';
// In RC 1.6+ smtp_server was renamed to smtp_host and includes port // Host already contains scheme (ssl:// or tls://) from form
$smtpHost = $r['smtp_host'] ?: 'localhost'; $smtpHost = $r['smtp_host'] ?: 'localhost';
if ($r['flags'] & ident_switch::DB_SECURE_IMAP_TLS) {
if (str_contains($smtpHost, ':')) {
ident_switch::write_log('SMTP server already contains protocol, ignoring TLS flag.');
} else {
$smtpHost = 'tls://' . $smtpHost;
}
}
$smtpPort = $r['smtp_port'] ?: 587; $smtpPort = $r['smtp_port'] ?: 587;
$args['smtp_host'] = $smtpHost . ':' . $smtpPort; $args['smtp_host'] = $smtpHost . ':' . $smtpPort;
} }

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Servername'; $labels['form.imap.host'] = 'Servername';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Sichere Verbindung (TLS)'; $labels['form.imap.security'] = 'Sicherheit';
// Port // Port
$labels['form.imap.port'] = 'Port'; $labels['form.imap.port'] = 'Port';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Servername'; $labels['form.smtp.host'] = 'Servername';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Sichere Verbindung (TLS)'; $labels['form.smtp.security'] = 'Sicherheit';
// Port // Port
$labels['form.smtp.port'] = 'Port'; $labels['form.smtp.port'] = 'Port';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Servername'; $labels['form.sieve.host'] = 'Servername';
// Security
$labels['form.sieve.security'] = 'Sicherheit';
// Port // Port
$labels['form.sieve.port'] = 'Port'; $labels['form.sieve.port'] = 'Port';
@@ -111,6 +114,20 @@ $labels['form.notify.off'] = 'Aus';
$labels['form.notify.requires_newmail_notifier'] = 'Benachrichtigungen erfordern das Plugin newmail_notifier. Bitte aktivieren Sie es oder kontaktieren Sie Ihren Administrator.'; $labels['form.notify.requires_newmail_notifier'] = 'Benachrichtigungen erfordern das Plugin newmail_notifier. Bitte aktivieren Sie es oder kontaktieren Sie Ihren Administrator.';
// Security options
// None
$labels['form.security.none'] = 'Keine';
// STARTTLS
$labels['form.security.starttls'] = 'STARTTLS';
// SSL/TLS
$labels['form.security.ssl'] = 'SSL/TLS';
// None warning
$labels['form.security.none_warning'] = 'Unverschlüsselte Verbindungen sind unsicher. Ihre Anmeldedaten und E-Mails können abgefangen werden. Verwenden Sie nach Möglichkeit SSL/TLS oder STARTTLS.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Server host name'; $labels['form.imap.host'] = 'Server host name';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Secure connection (TLS)'; $labels['form.imap.security'] = 'Security';
// Port // Port
$labels['form.imap.port'] = 'Port'; $labels['form.imap.port'] = 'Port';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Server host name'; $labels['form.smtp.host'] = 'Server host name';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Secure connection (TLS)'; $labels['form.smtp.security'] = 'Security';
// Port // Port
$labels['form.smtp.port'] = 'Port'; $labels['form.smtp.port'] = 'Port';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Server host name'; $labels['form.sieve.host'] = 'Server host name';
// Security
$labels['form.sieve.security'] = 'Security';
// Port // Port
$labels['form.sieve.port'] = 'Port'; $labels['form.sieve.port'] = 'Port';
@@ -112,6 +115,13 @@ $labels['form.notify.off'] = 'Off';
$labels['form.notify.requires_newmail_notifier'] = 'Notifications require the newmail_notifier plugin. Please enable it or contact your administrator.'; $labels['form.notify.requires_newmail_notifier'] = 'Notifications require the newmail_notifier plugin. Please enable it or contact your administrator.';
// Security options
$labels['form.security.none'] = 'None';
$labels['form.security.starttls'] = 'STARTTLS';
$labels['form.security.ssl'] = 'SSL/TLS';
$labels['form.security.none_warning'] = 'Unencrypted connections are insecure. Your credentials and emails may be intercepted. Use SSL/TLS or STARTTLS whenever possible.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Serveur'; $labels['form.imap.host'] = 'Serveur';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Connexion sécurisée (TLS)'; $labels['form.imap.security'] = 'Sécurité';
// Port // Port
$labels['form.imap.port'] = 'Port'; $labels['form.imap.port'] = 'Port';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Serveur'; $labels['form.smtp.host'] = 'Serveur';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Connexion sécurisée (TLS)'; $labels['form.smtp.security'] = 'Sécurité';
// Port // Port
$labels['form.smtp.port'] = 'Port'; $labels['form.smtp.port'] = 'Port';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Serveur'; $labels['form.sieve.host'] = 'Serveur';
// Security
$labels['form.sieve.security'] = 'Sécurité';
// Port // Port
$labels['form.sieve.port'] = 'Port'; $labels['form.sieve.port'] = 'Port';
@@ -111,6 +114,13 @@ $labels['form.notify.off'] = 'Désactivé';
$labels['form.notify.requires_newmail_notifier'] = 'Les notifications nécessitent le plugin newmail_notifier. Veuillez l\'activer ou contacter votre administrateur.'; $labels['form.notify.requires_newmail_notifier'] = 'Les notifications nécessitent le plugin newmail_notifier. Veuillez l\'activer ou contacter votre administrateur.';
// Security options
$labels['form.security.none'] = 'Aucune';
$labels['form.security.starttls'] = 'STARTTLS';
$labels['form.security.ssl'] = 'SSL/TLS';
$labels['form.security.none_warning'] = 'Les connexions non chiffrées sont vulnérables. Vos identifiants et emails peuvent être interceptés. Utilisez SSL/TLS ou STARTTLS autant que possible.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Nome del server'; $labels['form.imap.host'] = 'Nome del server';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Connessione sicura (TLS)'; $labels['form.imap.security'] = 'Sicurezza';
// Port // Port
$labels['form.imap.port'] = 'Porta'; $labels['form.imap.port'] = 'Porta';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Nome del server'; $labels['form.smtp.host'] = 'Nome del server';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Connessione sicura (TLS)'; $labels['form.smtp.security'] = 'Sicurezza';
// Port // Port
$labels['form.smtp.port'] = 'Porta'; $labels['form.smtp.port'] = 'Porta';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Nome del server'; $labels['form.sieve.host'] = 'Nome del server';
// Security
$labels['form.sieve.security'] = 'Sicurezza';
// Port // Port
$labels['form.sieve.port'] = 'Porta'; $labels['form.sieve.port'] = 'Porta';
@@ -111,6 +114,20 @@ $labels['form.notify.off'] = 'Disattivo';
$labels['form.notify.requires_newmail_notifier'] = 'Le notifiche richiedono il plugin newmail_notifier. Abilitarlo o contattare l\'amministratore.'; $labels['form.notify.requires_newmail_notifier'] = 'Le notifiche richiedono il plugin newmail_notifier. Abilitarlo o contattare l\'amministratore.';
// Security options
// None
$labels['form.security.none'] = 'Nessuna';
// STARTTLS
$labels['form.security.starttls'] = 'STARTTLS';
// SSL/TLS
$labels['form.security.ssl'] = 'SSL/TLS';
// None warning
$labels['form.security.none_warning'] = 'Le connessioni non crittografate non sono sicure. Le credenziali e le email possono essere intercettate. Utilizzare SSL/TLS o STARTTLS quando possibile.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Servernaam'; $labels['form.imap.host'] = 'Servernaam';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Beveiligde verbinding (TLS)'; $labels['form.imap.security'] = 'Beveiliging';
// Port // Port
$labels['form.imap.port'] = 'Poortnummer'; $labels['form.imap.port'] = 'Poortnummer';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Servernaam'; $labels['form.smtp.host'] = 'Servernaam';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Beveiligde verbinding (TLS)'; $labels['form.smtp.security'] = 'Beveiliging';
// Port // Port
$labels['form.smtp.port'] = 'Poortnummer'; $labels['form.smtp.port'] = 'Poortnummer';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Servernaam'; $labels['form.sieve.host'] = 'Servernaam';
// Security
$labels['form.sieve.security'] = 'Beveiliging';
// Port // Port
$labels['form.sieve.port'] = 'Poortnummer'; $labels['form.sieve.port'] = 'Poortnummer';
@@ -111,6 +114,20 @@ $labels['form.notify.off'] = 'Uit';
$labels['form.notify.requires_newmail_notifier'] = 'Meldingen vereisen de newmail_notifier-plug-in. Schakel deze in of neem contact op met uw beheerder.'; $labels['form.notify.requires_newmail_notifier'] = 'Meldingen vereisen de newmail_notifier-plug-in. Schakel deze in of neem contact op met uw beheerder.';
// Security options
// None
$labels['form.security.none'] = 'Geen';
// STARTTLS
$labels['form.security.starttls'] = 'STARTTLS';
// SSL/TLS
$labels['form.security.ssl'] = 'SSL/TLS';
// None warning
$labels['form.security.none_warning'] = 'Onversleutelde verbindingen zijn onveilig. Uw inloggegevens en e-mails kunnen worden onderschept. Gebruik waar mogelijk SSL/TLS of STARTTLS.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Адрес сервера'; $labels['form.imap.host'] = 'Адрес сервера';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Безопасное подключение (TLS)'; $labels['form.imap.security'] = 'Безопасность';
// Port // Port
$labels['form.imap.port'] = 'Порт'; $labels['form.imap.port'] = 'Порт';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Адрес сервера'; $labels['form.smtp.host'] = 'Адрес сервера';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Безопасное подключение (TLS)'; $labels['form.smtp.security'] = 'Безопасность';
// Port // Port
$labels['form.smtp.port'] = 'Порт'; $labels['form.smtp.port'] = 'Порт';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Адрес сервера'; $labels['form.sieve.host'] = 'Адрес сервера';
// Security
$labels['form.sieve.security'] = 'Безопасность';
// Port // Port
$labels['form.sieve.port'] = 'Порт'; $labels['form.sieve.port'] = 'Порт';
@@ -111,6 +114,20 @@ $labels['form.notify.off'] = 'Выключено';
$labels['form.notify.requires_newmail_notifier'] = 'Уведомления требуют плагин newmail_notifier. Пожалуйста, включите его или обратитесь к администратору.'; $labels['form.notify.requires_newmail_notifier'] = 'Уведомления требуют плагин newmail_notifier. Пожалуйста, включите его или обратитесь к администратору.';
// Security options
// None
$labels['form.security.none'] = 'Нет';
// STARTTLS
$labels['form.security.starttls'] = 'STARTTLS';
// SSL/TLS
$labels['form.security.ssl'] = 'SSL/TLS';
// None warning
$labels['form.security.none_warning'] = 'Незашифрованные соединения небезопасны. Ваши учётные данные и письма могут быть перехвачены. По возможности используйте SSL/TLS или STARTTLS.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).

View File

@@ -23,8 +23,8 @@ $labels['form.imap.caption'] = 'IMAP';
// Server host name // Server host name
$labels['form.imap.host'] = 'Ime oz. naslov IMAP strežnika'; $labels['form.imap.host'] = 'Ime oz. naslov IMAP strežnika';
// Secure connection (TLS) // Security
$labels['form.imap.tls'] = 'Varna povezava (TLS)'; $labels['form.imap.security'] = 'Varnost';
// Port // Port
$labels['form.imap.port'] = 'Vrata'; $labels['form.imap.port'] = 'Vrata';
@@ -48,8 +48,8 @@ $labels['form.smtp.caption'] = 'SMTP';
// Server host name // Server host name
$labels['form.smtp.host'] = 'Ime oz. naslov SMTP strežnika'; $labels['form.smtp.host'] = 'Ime oz. naslov SMTP strežnika';
// Secure connection (TLS) // Security
$labels['form.smtp.tls'] = 'Varna povezava (TLS)'; $labels['form.smtp.security'] = 'Varnost';
// Port // Port
$labels['form.smtp.port'] = 'Vrata'; $labels['form.smtp.port'] = 'Vrata';
@@ -70,6 +70,9 @@ $labels['form.sieve.caption'] = 'Sieve';
// Server host name // Server host name
$labels['form.sieve.host'] = 'Ime oz. naslov Sieve strežnika'; $labels['form.sieve.host'] = 'Ime oz. naslov Sieve strežnika';
// Security
$labels['form.sieve.security'] = 'Varnost';
// Port // Port
$labels['form.sieve.port'] = 'Vrata'; $labels['form.sieve.port'] = 'Vrata';
@@ -111,6 +114,20 @@ $labels['form.notify.off'] = 'Izključeno';
$labels['form.notify.requires_newmail_notifier'] = 'Obvestila zahtevajo vtičnik newmail_notifier. Prosimo, omogočite ga ali se obrnite na skrbnika.'; $labels['form.notify.requires_newmail_notifier'] = 'Obvestila zahtevajo vtičnik newmail_notifier. Prosimo, omogočite ga ali se obrnite na skrbnika.';
// Security options
// None
$labels['form.security.none'] = 'Brez';
// STARTTLS
$labels['form.security.starttls'] = 'STARTTLS';
// SSL/TLS
$labels['form.security.ssl'] = 'SSL/TLS';
// None warning
$labels['form.security.none_warning'] = 'Nešifrirane povezave so nevarne. Vaše poverilnice in e-pošta so lahko prestreženi. Kadar koli je mogoče, uporabite SSL/TLS ali STARTTLS.';
// Errors // Errors
// Value in \'Server host name\' field is too long (64 chars max). // Value in \'Server host name\' field is too long (64 chars max).