hMailServer - roundcube 設定篇

介紹 roundcube 一些常用的設定。

檔案準備

MIME 對應表
http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types

設定檔說明

roundcube 將設定存在兩個檔案:

  • config\defaults.inc.php: 預設設定
  • config\config.inc.php: 自訂設定

首先會載入 defaults.inc.php 的設定,接著如果 config.inc.php 存在相同設定,會將預設設定值覆蓋,因此修改設定請編輯 config.inc.php,不要去修改 defaults.inc.php。所有的設定都可以在 defaults.inc.php 找到,本文只列出幾個我有用到的設定。

用文字編輯器開啟 config.inc.php

// ----------------------------------
// SMTP
// ----------------------------------
// SMTP server 位址
$config['smtp_server'] = 'Mail server public IP.';
// 使用目前的帳號登入 SMTP
$config['smtp_user'] = '%u';
// 使用目前的密碼登入 SMTP
$config['smtp_pass'] = '%p';
// SMTP 需要帳號及密碼驗證
$config['smtp_auth_type'] = 'LOGIN';

// ----------------------------------
// SYSTEM
// ----------------------------------
// 禁止使用者調整的選項
$config['dont_override'] = array('drafts_mbox', 'junk_mbox', 'sent_mbox', 'trash_mbox', 'show_real_foldernames');
// 允許瀏覽器於登入頁使用自動完成
$config['login_autocomplete'] = 1;
// 只能有一個身分且不能更改email
$config['identities_level'] = 3;
// MIME 對應表的絕對路徑
// 將前面下載的 MIME 對應表放到 config 資料夾,注意路徑中的 \ 字元要改成 \\
$config['mime_types'] = 'C:\\Websites\\roundcube\\httpdocs\\config\\mime.types';

// ----------------------------------
// PLUGINS
// ----------------------------------
// 啟用的 plugin 清單,array 中填入要啟用的 plugin,plugins 資料夾底下的子資料夾名稱就是 plugin 名稱
$config['plugins'] = array('plugin1', 'plugin2');

// ----------------------------------
// USER INTERFACE
// ----------------------------------
// 初次登入時自動建立預設資料夾
$config['create_default_folders'] = true;
// 關閉拼字檢查
$config['enable_spellcheck'] = false;
// 郵件列表的每頁最大筆數,使用者無法設定超過這個筆數
$config['max_pagesize'] = 100;
// 自動檢查新郵件的最少間隔(秒)
$config['min_refresh_interval'] = 300;

// ----------------------------------
// USER PREFERENCES
// ----------------------------------
// 預設編碼
$config['default_charset'] = 'UTF-8';
// 預設檢查新郵件的間隔(秒)
$config['refresh_interval'] = 300;
// 回覆時將新訊息置於上方
$config['reply_mode'] = 1;

Reference

Roundcube configuration options
https://github.com/roundcube/roundcubemail/wiki/Configuration