LAMP+RoundCube で。
Ubuntu-11.10-server-amd64 で確認。
このトピックは Ubuntu で DNS サーバー Ubuntu で LDAP サーバー Ubuntu でメールサーバー の環境で動作するよう構成しています。
作成 2012.03.26
更新 2012.04.28
更新 2012.04.28
Ubuntu で Web メールサーバー2
構成
| ホスト名 | IP アドレス | 用途 | 
| dns | 192.168.0.102 | DNS サーバー 構築済み | 
| ldap | 192.168.0.103 | LDAP サーバー 構築済み | 
| 192.168.0.104 | SMTP, IMAP4 サーバー 構築済み | |
| webmail2 | 192.168.0.106 | Web メールサーバー | 
インストール
MySQL, Apache, PHP そして RoundCube をインストールする。
パッケージを全部まとめてインストールすると設定に矛盾が生じてインストールに失敗する。
パッケージを全部まとめてインストールすると設定に矛盾が生じてインストールに失敗する。
$sudo apt-get install mysql-server mysql-client $sudo apt-get install apache2 libapache2-mod-php5 zend-framework php-net-socket php5-mysql php5-mcrypt $sudo apt-get install php-mdb2-driver-mysql $sudo apt-get install roundcubeRoundCube インストール時に、使用するデータベースの問い合わせがある。mysql を選択。sqlite を選択すると、動作しなかった。
| 設定 | 値 | 
| MySQL 管理者パスワード | exadmin | 
| RoundCube 用 MySQL アプリケーションパスワード | roundsql | 
設定
/etc/roundcube/apache.conf の Alias のコメントアウトを外す。
example.com をデフォルトにしたい場合は、/etc/hosts にアドレスを指定すればよい。
/etc/hosts に追記
# Those aliases do not work properly with several hosts on your apache server
# Uncomment them to use it or adapt them to your configuration
Alias /roundcube/program/js/tiny_mce/ /usr/share/tinymce/www/
Alias /roundcube /var/lib/roundcube
# Access to tinymce files
<Directory "/usr/share/tinymce/www/">
      Options Indexes MultiViews FollowSymLinks
      AllowOverride None
      Order allow,deny
      allow from all
</Directory>
<Directory /var/lib/roundcube/>
  Options +FollowSymLinks
  # This is needed to parse /var/lib/roundcube/.htaccess. See its
  # content before setting AllowOverride to None.
  AllowOverride All
  order allow,deny
  allow from all
</Directory>
# Protecting basic directories:
<Directory /var/lib/roundcube/config>
        Options -FollowSymLinks
        AllowOverride None
</Directory>
<Directory /var/lib/roundcube/temp>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>
<Directory /var/lib/roundcube/logs>
        Options -FollowSymLinks
        AllowOverride None
        Order allow,deny
        Deny from all
</Directory>
このファイルは、/etc/apache2/conf.d/roundcube からシンボリック リンクが貼られているため、編集後 Apache を再起動するだけで有効になる。
$ sudo service apache2 restart/etc/roundcube/main.inc.php 変更部分のみ
$rcmail_config['default_host'] = 'mail.example.com'; $rcmail_config['smtp_server'] = '192.168.0.104';default_host の設定は IMAP サーバーの接続先として使用されるだけでなく、ユーザーのメールアドレスのドメインとして使用される。つまり、user0001@mail.example.com がデフォルト値として設定される。
example.com をデフォルトにしたい場合は、/etc/hosts にアドレスを指定すればよい。
/etc/hosts に追記
192.168.0.104 mail.example.com example.com/etc/roundcube/main.inc.php 修正
$rcmail_config['default_host'] = 'example.com';
ログ
Web サーバーに関するログは /var/log/apache2/ へ保存される。
RoundCube に関するログは /var/log/roundcube/ へ保存される。
RoundCube に関するログは /var/log/roundcube/ へ保存される。
実行画面
RoundCube の認証画面は IMAP4 の認証が利用されるため、Web メールサーバー側でユーザー登録する必要がない。
データベースにはアドレス帳や個人設定が保存される。

あと、コードが古いらしく以下のログが延々と記録される。
/var/log/roundcube/errors
データベースにはアドレス帳や個人設定が保存される。

あと、コードが古いらしく以下のログが延々と記録される。
/var/log/roundcube/errors
[27-Mar-2012 00:31:40] PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/MDB2.php on line 393 [27-Mar-2012 00:31:40] PHP Deprecated: Assigning the return value of new by reference is deprecated in /usr/share/php/MDB2.php on line 2647これを抑制するには、/usr/share/roundcube/program/include/iniset.php を以下の要領で修正する。
// ini_set('error_reporting', E_ALL&~E_NOTICE);
ini_set('error_reporting', E_ALL&~E_NOTICE&~E_DEPRECATED);