目錄
- 多 frontend 的情況
- error_reporting
- Plugin: password
V 1.4.X Setting
最少要有的 config: config.inc.php
// 如何連 DB $config['db_dsnw'] = 'mysql://roundcube:?@localhost/roundcubemail'; // IMAP Server $config['default_host'] = 'mailserver'; // SMTP Server $config['smtp_server'] = 'mailserver'; // This key is used for encrypting purposes, like storing of imap password in the session. $config['des_key'] = '123456789012345678901234'; // 必須是 24 個字
其他 settings
SMTP Server 設定
// 沒有這 setting 時, 它會用 php 的 mail function $config['smtp_server'] = 'localhost'; $config['smtp_port'] = 587; // login setting, 填上後, 會無視了 Allow local, 始終會 SASL login $config['smtp_user'] = '%u'; $config['smtp_pass'] = '%p'; $config['smtp_auth_type'] = 'PLAIN'; // /etc/hosts 內要有 "127.0.0.1 mail.datahunter.org" $config['smtp_helo_host'] = 'mail.datahunter.org';
Notes
當 SMTP 強制要求 StartTLS 時
$config['smtp_server'] = 'tls://mailserver';
IMAP Server 設定
// By default the most secure method (from supported) will be selected. $config['imap_auth_type'] = 'PLAIN';
設定了它們會更好
// in minutes $config['session_lifetime'] = 60; // automatically create folders on user login (Drafts, Trash, Sent, Junk) $config['create_default_folders'] = true; // 行 mod_php 時可以考慮 true $config['db_persistent'] = true;
Data
$config['default_charset'] = 'UTF-8'; $config['draft_autosave'] = 300;
UI
$config['refresh_interval'] = 60;
$config['language'] = 'zh_TW';
$config['timezone'] = 'Asia/Hong_Kong';
// This is displayed on the login screen and in the window title
$config['product_name'] = 'My Webmail';
//// list / threads (threads: Show multiple emails in a thread as a single conversation)
$config['default_list_mode'] = 'list';
$config['skin_logo'] = 'custom/logo.png';
// Login page 底沒有 "Roundcube Webmail"
$config['product_name'] = '';
Notes
skin_logo
- 別將 logo.png 放入 skins/
-
URL relative to the document root of this Roundcube installation
i.e.
$config['skin_logo'] = 'custom/logo.png'; - full URL with http:// or https:// prefix
- URL relative to the current skin folder (when starts with a '/')
Reply setting
// 1 - place cursor above original message (top posting) $config['reply_mode'] = 1; // Default behavior of Reply-All button: 0 - Reply-All always $config['reply_all_mode'] = 0; $config['htmleditor'] = 1; $config['useragent'] = 'Roundcube Webmail';
Security
$config['log_logins'] = true; // Log successful/failed logins to <log_dir>/userlogins.log or to syslog $config['login_autocomplete'] = 1; // 1 = username and host only $config['display_product_info'] = 0; // login page 底的 "Roundcube Webmail" $config['ip_check'] = true; $config['smtp_log'] = true; $config['use_https'] = false; $config['session_domain'] = 'mail.datahunter.org';
Cache Settings
# 當使用 DB 做 Cache
// table: "cache" $config['imap_cache'] = 'db'; // Lifetime of IMAP indexes cache $config['imap_cache_ttl'] = '14d'; // Enables messages cache. Only 'db' cache is supported // db table: "cache_messages" $config['messages_cache'] = true; $config['messages_cache_ttl'] = '7d'; // Note: On MySQL this should be less than (max_allowed_packet - 30%) $config['messages_cache_threshold'] = 50;
# 當使用 memcached 做 Cache
$config['imap_cache'] = 'memcached'; $config['memcache_hosts'] = 'localhost:11211'; $config['imap_cache_ttl'] = '10d';
Performance
// Set true if deleted messages should not be displayed
// This will make the application run slower
$config['skip_deleted'] = true;
Ohter Settings
// don't let users set pagesize to more than this value if set $config['max_pagesize'] = 100; // If true all folders will be checked for recent messages $config['check_all_folders'] = false; // Daylight saving time $config['dst_active'] = false; // 不回應回條要求 $config['mdn_requests'] = 0;
Notes
read receipt
// GUI: On request for return receipt // 0 = ask the user, // 2 = ignore (never send or ask) // 3 = send automatically if sender is in my contacts, otherwise ask the user // 5 = send automatically if sender is a trusted sender, otherwise ask the user $config['mdn_requests'] = 0;
Plugin
$config['plugins'] = array( 'jqueryui', 'archive', 'emoticons', 'autologon', 'hide_blockquote', 'newmail_notifier', 'show_additional_headers', 'attachment_reminder', );
SMTP TLS/SSL Settings
smtp_server
$config['smtp_server'] = 'localhost';
- Prefix ssl:// or tls:// (ie. tls://localhost:465)
- If left blank, the PHP mail() function is used
smtp_conn_options
$config['smtp_conn_options'] = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, ), );
error_reporting
V1.4 有自己的 error_reporting 設定. 不跟 php.ini
program/lib/Roundcube/bootstrap.php
$config = [
'error_reporting' => E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED,
'display_errors' => false,
'log_errors' => true,
// Some users are not using Installer, so we'll check some
// critical PHP settings here. Only these, which doesn't provide
// an error/warning in the logs later. See (#1486307).
'mbstring.func_overload' => 0,
];
多 frontend 的情況
// stickiness $config['session_storage'] = 'db';
Plugin: password
# roundcubemail-1.5.7
cp config.inc.php.dist config.inc.php
$config['password_driver'] = 'sql'; $config['password_db_dsn'] = 'mysqli://user:pw@host/db'; $config['password_confirm_current'] = true; $config['password_minimum_length'] = 8; $config['password_minimum_score'] = 5; $config['password_log'] = true; // Default password hashing/crypting algorithm. $config['password_algorithm'] = 'dovecot'; // when using password_algorithm = 'dovecot' $config['password_dovecotpw'] = "/usr/bin/doveadm pw"; // when using password_algorithm = 'dovecot' $config['password_dovecotpw_method'] = 'SSHA512'; // when using password_algorithm = 'dovecot' // Enables use of password with method prefix $config['password_dovecotpw_with_method'] = true; // %P is replaced with the crypted/hashed new password // according to configured password_method $config['password_query'] = 'UPDATE mailbox SET password=%P,passwordlastchange=NOW() WHERE username=%u';
Plugins: managesieve
cp config.inc.php.dist config.inc.php
$config['managesieve_port'] = 4190; $config['managesieve_host'] = 'mailserver'; $config['managesieve_auth_type'] = 'LOGIN';
Enables separate management interface for setting
$config['managesieve_vacation'] = 1; $config['managesieve_forward'] = 1;
左邊 Menu 的 UI
... Filters Out of Office Forwarding
Advanced settings 內的設定
Reply sender address My e-mail addresses Reply interval
Settings
$config['managesieve_vacation_addresses_init'] = true; $config['managesieve_vacation_from_init'] = true; $config['managesieve_vacation_interval'] = "86400s";