Add managesieve (Sieve) support for remote accounts
When switching identities, the managesieve plugin still connected to the default sieve server. Hook into managesieve_connect to redirect the sieve connection to the remote account's server. Adds sieve_host, sieve_port and sieve_auth columns to the database, a Sieve section to the identity settings form, preconfig support for sieve_host, and localized labels for all 7 languages.
This commit is contained in:
@@ -110,6 +110,22 @@ class IdentSwitchPreconfig
|
||||
$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;
|
||||
if (!empty($cfg['user'])) {
|
||||
match (strtoupper($cfg['user'])) {
|
||||
|
||||
Reference in New Issue
Block a user