Files
roundcube-ident_switch/config.inc.php.dist
Laurent Dinclaux fd9836c7ae Add custom auth, connection testing, preconfig_only, and security fixes
Major form improvements:
- Custom SMTP/Sieve credentials (separate username/password per protocol)
- Connection testing on save (IMAP, SMTP, Sieve) with localized errors
- preconfig_only mode to restrict domains to preconfigured entries
- Form POST value preservation on save errors (auth selects, passwords)
- Smart host placeholders (SMTP/Sieve default to IMAP host)

Security and bug:
- Fix password re-encryption bug (was comparing raw vs encrypted values)
- Fix XSS: escape label output in special folders form
- Fix parse_url() return value not checked for false
- Fix decrypt() failures not handled (fallback to empty string)
- Sanitize log output (remove raw POST data from log messages)
- Replace weak == comparisons with strict === (PHP and JS)

SQL changes:
- Consolidate 4 migrations (2026021000-03) into single 2026021000
- Remove now unused notify_sound_url column
- Add smtp_username, smtp_password, sieve_username, sieve_password columns
2026-02-10 20:50:05 +11:00

95 lines
3.0 KiB
Plaintext

<?php
/**
* ident_switch - Configuration file.
*
* Copyright (C) 2016 Boris Gulay
* Copyright (C) 2026 Gecka
*
* Original code licensed under GPL-3.0+.
* New contributions licensed under AGPL-3.0+.
*
* @url https://github.com/Gecka-apps/ident_switch
*/
/*
* Preconfigured settings for different mail domains.
* Appropriate set of values is searched by mapping domain of email (from identity) to array key.
* Use '*' as a wildcard to match any domain not explicitly listed.
*/
$config['ident_switch.preconfig'] = [
// Domain part of email address
'domain.tld' => [
// IMAP connection: scheme://host:port
// Schemes: ssl:// for IMAPS (port 993), tls:// for STARTTLS (port 143).
// Required.
'imap_host' => 'ssl://mail.domain.tld:993',
// SMTP connection: scheme://host:port
// Schemes: tls:// for STARTTLS (port 587), ssl:// for SMTPS (port 465).
// Falls back to imap_host if not specified.
'smtp_host' => 'tls://mail.domain.tld:587',
// Sieve (managesieve) connection: scheme://host:port
// Schemes: tls:// for STARTTLS (port 4190), ssl:// for implicit TLS.
// Optional. Only needed if the managesieve plugin is installed.
'sieve_host' => 'tls://mail.domain.tld:4190',
// Login name, can be 'email' (full address from identity), 'mbox' (only mailbox part).
// Any other value is treated as 'not specified' (default).
'user' => 'email',
// IMAP folder hierarchy delimiter.
// Omit or set to null for auto-detect (recommended).
// 'delimiter' => '/',
// Are specified settings locked in interface or not.
// Default - false.
'readonly' => true,
],
'another.tld' => [
'imap_host' => 'tls://mail.another.tld:143',
'smtp_host' => 'tls://mail.another.tld:587',
'user' => 'mbox',
],
// Wildcard: default settings for any domain not listed above.
// '*' => [
// 'imap_host' => 'ssl://mail.example.com:993',
// 'smtp_host' => 'tls://mail.example.com:587',
// 'user' => 'email',
// ],
];
/*
* Enable background mail checking across secondary accounts.
* Shows unread counts in the account switcher and a badge for new messages.
* Default: true.
*/
$config['ident_switch.check_mail'] = true;
/*
* Round-robin mode: check one identity per refresh cycle instead of all.
* Useful with many accounts to reduce IMAP connections per refresh.
* Default: false (all identities checked every cycle).
*/
$config['ident_switch.round_robin'] = false;
/*
* Hide the warning shown to users when the newmail_notifier plugin is not active.
* Default: false (warning is displayed).
*/
$config['ident_switch.hide_notifier_warning'] = false;
/*
* Restrict account switching to preconfigured domains only.
* When enabled, the ident_switch form is hidden for identities whose email
* domain does not match any entry in 'ident_switch.preconfig'.
* Users can still create Roundcube identities (name, signature, etc.) but
* cannot configure server connections for non-preconfigured domains.
* Default: false (all domains allowed).
*/
$config['ident_switch.preconfig_only'] = false;