Fedora 16
Sponsored Link

Webメールシステム - RoundCube2011/11/13

 
RoundCube をインストールして、Yahoo メールや Hotmail のようなWebメールシステムを構築します。 ここの例ではメールサーバーにはローカルではなく、下記の通り、同一LAN内の別ホストのものを利用するように設定します。 よって、対象ホストにSMTP/IMAPサーバー導入済みが前提です。 またバックエンドでデータベースを使うため、MySQL, SQLite, PostgreSQL のいずれかを導入済みである必要があります。 ここではMySQL 導入済みを前提として進めます。
 
www.srv.world
- RoundCube 導入サーバー

 
mail.srv.world
- SMTP/IMAPサーバー
[1] RoundCube のインストールと設定
[root@www ~]#
yum -y install roundcubemail
[root@www ~]#
mysql -u root -p
# MySQLに接続

Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 2
Server version: 5.5.16 MySQL Community Server (GPL)

Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

# 「roundcube」データベース作成 ( 'password'の箇所は設定するパスワードを入力 )

mysql>
create database roundcube character set utf8 collate utf8_bin;

Query OK, 1 row affected (0.00 sec)
mysql>
grant all privileges on roundcube.* to roundcube@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
mysql>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
mysql>
exit

Bye
[root@www ~]#
cd /usr/share/doc/roundcubemail-*/SQL

[root@www SQL]#
mysql -u roundcube -p roundcube < mysql.initial.sql

Enter password:
[root@www SQL]#
[root@www ~]#
vi /etc/roundcubemail/db.inc.php
# 21行目:以下のように変更 ('password'の箇所はroundcubeに設定したパスワード)

$rcmail_config['db_dsnw'] = 'mysql://roundcube:
password
@localhost/
roundcube
';
[root@www ~]#
vi /etc/roundcubemail/main.inc.php
# 29行目:ログの日付形式を「年-月-日 時:分:秒」に変更

$rcmail_config['log_date_format'] = '
Y-M-d H:i:s O
';
# 68行目:IMAPサーバーを指定 (SSL経由)

$rcmail_config['default_host'] = '
ssl://mail.srv.world
';
# 71行目:IMAPポート変更 (SSL経由)

$rcmail_config['default_port'] =
993
;
# 124行目:SMTPサーバーを指定 (SSL経由)

$rcmail_config['smtp_server'] = '
ssl://mail.srv.world
';
# 127行目:SMTPポート変更 (SSL経由)

$rcmail_config['smtp_port'] =
465
;
# 131行目:変更 ( SMTP認証にIMAP認証と同じユーザー名を使う )

$rcmail_config['smtp_user'] = '
%u
';
# 135行目:変更 ( SMTP認証にIMAP認証と同じパスワードを使う )

$rcmail_config['smtp_pass'] = '
%p
';
# 139行目:変更 ( SMTP認証タイプ )

$rcmail_config['smtp_auth_type'] = '
LOGIN
';
# 151行目:SMTP HELO host を指定

$rcmail_config['smtp_helo_host'] = '
mail.srv.world
';
# 243行目:ドメインを指定

$rcmail_config['mail_domain'] = '
srv.world
';
# 261行目:UserAgent変更

$rcmail_config['useragent'] = '
Server World Webmail
';
# 264行目:表示画面のタイトルを変更

$rcmail_config['product_name'] = '
Server World Webmail
';
# 341行目:日本語に変更

$rcmail_config['language'] =
ja_JP
;
# 347行目:表示画面の日付形式を「年.月.日 時:分」に変更

$rcmail_config['date_long'] = '
Y.m.d H:i
';
# 501行目:デフォルト文字セット変更

$rcmail_config['default_charset'] = '
iso-2022-jp
';
[root@www ~]#
vi /etc/httpd/conf.d/roundcubemail.conf
# 5行目:変更

Alias
/roundcube
/usr/share/roundcubemail
<Directory /usr/share/roundcubemail/>
Order Deny,Allow

Deny from all

Allow from 127.0.0.1
10.0.0.0/24
# アクセス許可IP追記

</Directory>
[root@www ~]#
systemctl restart httpd.service

[2] ブラウザから「http://(サーバーのホスト名またはIPアドレス)/roundcube/」にアクセスします。すると 以下のようにログイン画面になるのでユーザー名とパスワードを入力してログインします。
[3] ログインできました。
関連コンテンツ