CentOS7

Webmailシステム構築(RoundCube Webmail)

HotmailYahoo!メールのようにWebブラウザ上でメールができるWebmailシステムであるRoundCube Webmailを導入する。

RoundCube WebmailAjaxを使用したリッチユーザーインタフェースが特徴のWebメールシステム。

RoundCube Webmailインストール

[root@localhost ~]# wget https://github.com/roundcube/roundcubemail/releases/download/1.3.4/roundcubemail-1.3.4-complete.tar.gz ← RoundCube Webmailダウンロード
※最新版のURLはダウンロードページで確認すること
[root@localhost ~]# tar zxvf roundcubemail-*.tar.gz ← RoundCube Webmail展開
[root@localhost ~]# mv roundcubemail-*/ /var/www/roundcubemail ← RoundCube Webmail展開先ディレクトリを所定の場所へ移動
[root@localhost ~]# chmod o+w /var/www/roundcubemail/temp/ ← tempディレクトリへ書き込み権限付与
[root@localhost ~]# chmod o+w /var/www/roundcubemail/logs/ ← logsディレクトリへ書き込み権限付与
[root@localhost ~]# rm -f roundcubemail-*.tar.gz ← ダウンロードしたファイルを削除

DB設定

[root@localhost ~]# yum -y install php-mysql php-xml ← php-mysqlphp-xmlインストール
[root@localhost ~]# mysql -u root -p ← データベースサーバーへrootでログイン
Enter password: ← データベースサーバーのrootパスワードを応答
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 5

Server version: 5.5.37-MariaDB MariaDB Server

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
MariaDB [(none)]> CREATE DATABASE roundcubemail; ← roundcubemailデータベース作成
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON roundcubemail.* TO roundcube@localhost IDENTIFIED BY '任意のパスワード'; ← roundcubemailデータベースアクセスユーザーroundcube作成
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> exit ← データベースサーバーからログアウト
Bye
[root@localhost ~]# mysql -u roundcube -p roundcubemail < /var/www/roundcubemail/SQL/mysql.initial.sql ← roundcubemailデータベース初期化
Enter password: ← データベースサーバーのroundcubeユーザーパスワードを応答

RoundCube Webmail設定

[root@localhost ~]# vi /etc/php.ini ← PHP設定ファイル編集
[Date]
; Defines the default timezone used by the date functions
; http://php.net/date.timezone
;date.timezone =
date.timezone = Asia/Tokyo ← タイムゾーン設定追加※メール一覧で日付が表示されるようにする
[root@localhost ~]# vi /var/www/roundcubemail/config/defaults.inc.php ← RoundCube Webmailデフォルト設定ファイル編集
// This domain will be used to form e-mail addresses of new users
// Specify an array with 'host' => 'domain' values to support multiple hosts
// Supported replacement variables:
// %h - user's IMAP hostname
// %n - http hostname ($_SERVER['SERVER_NAME'])
// %d - domain (http hostname without the first part)
// %z - IMAP domain (IMAP hostname without the first part)
// For example %n = mail.domain.tld, %t = domain.tld
$config['mail_domain'] = 'hoge.com'; ← 送信元メールアドレスの@以下を指定(例:hoge.com)

// Use this charset as fallback for message decoding
$config['default_charset'] = 'ISO-2022-JP'; ← 日本語対応

// enforce connections over https
// with this option enabled, all non-secure connections will be redirected.
// set the port for the ssl connection as value of this option if it differs from the default 443
$config['force_https'] = true; ← httpsアクセス(暗号化通信)を強制

// the way how contact names are displayed in the list
// 0: display name
// 1: (prefix) firstname middlename surname (suffix)
// 2: (prefix) surname firstname middlename (suffix)
// 3: (prefix) surname, firstname middlename (suffix)$config['addressbook_name_listing'] = 2; ← アドレス帳で姓名の形式で表示する

// Set true if deleted messages should not be displayed
// This will make the application run slower
$config['skip_deleted'] = true; ← 削除済のメッセージを表示しない

// If true, after message delete/move, the next message will be displayed
$config['display_next'] = false; ← メッセージ削除時に次のメッセージを表示しない=メッセージ一覧に戻る
[root@localhost ~]# echo Alias /roundcubemail /var/www/roundcubemail > /etc/httpd/conf.d/roundcubemail.conf ← Webアクセス設定ファイル作成
https://サーバー名/roundcubemail/でWebメールへアクセスできるようにする
[root@localhost ~]# systemctl reload httpd ← Webサーバー設定反映

Webブラウザでhttps://サーバー名/roundcubemail/installer/へアクセスする

NEXT」ボタン押下

Logging & Debugging

log_driver」で"syslog”を選択※ログを/var/log/messagesに出力するようにする

Database setup

Database password」にroundcubemailデータベースのパスワードを入力

IMAP Settings

default_host」にメールサーバー名(例:mail.hoge.com)を入力

junk_mbox」に"Spam"と入力

SMTP Settings

smtp_server」にメールサーバー名(例:mail.hoge.com)を入力

Use the current IMAP username and password for SMTP authentication」をチェック※SMTP認証にIMAPサーバーのユーザー名/パスワードを使用する

Display settings & user prefs

language」に"ja_JP"と入力

CREATE CONFIG」ボタン押下

Download」ボタン押下

ダウンロードしたconfig.inc.phpWinSCP/var/www/roundcubemail/configディレクトリへアップロードする。

CONTINUE」ボタン押下

[root@localhost ~]# rm -rf /var/www/roundcubemail/installer/ ← 不要となったインストーラを削除

RoundCube Webmail確認

http://サーバー名/roundcubemail/にアクセスして''RoundCube Webmail''ログインページが表示されることを確認。

また、URLがhttps://サーバー名/roundcubemail/となっていることを確認

※ログイン名にはメールアカウント名(例:hoge)、パスワードにはメールアカウントパスワードを入力する。

プラグイン追加(任意)

プラグインを追加して機能を拡張する。

コンテキストメニュー

右クリックで返信、転送、削除、既読未読設定、フラグ設定解除等を行えるようにする。

[root@localhost ~]# git clone https://github.com/JohnDoh/Roundcube-Plugin-Context-Menu /var/www/roundcubemail/plugins/contextmenu ← contextmenuプラグインダウンロード
[root@localhost ~]# vi /var/www/roundcubemail/config/config.inc.php ← RoundCube Webmail設定ファイル編集
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('contextmenu'); ← contextmenuを追加

モバイル対応

[root@localhost ~]# rm -rf /var/www/roundcubemail/skins/melanie2_larry_mobile ; git clone https://github.com/messagerie-melanie2/Roundcube-Skin-Melanie2-Larry-Mobile.git /var/www/roundcubemail/skins/melanie2_larry_mobile ← melanie2_larry_mobileスキンダウンロード
[root@localhost ~]# rm -rf /var/www/roundcubemail/plugins/jquery_mobile ; git clone https://github.com/messagerie-melanie2/Roundcube-Plugin-JQuery-Mobile.git /var/www/roundcubemail/plugins/jquery_mobile ← jquery_mobileプラグインダウンロード
[root@localhost ~]# rm -rf /var/www/roundcubemail/plugins/mobile ; git clone https://github.com/messagerie-melanie2/Roundcube-Plugin-Mobile.git /var/www/roundcubemail/plugins/mobile ← mobileプラグインダウンロード
[root@localhost ~]# vi /var/www/roundcubemail/config/config.inc.php ← RoundCube Webmail設定ファイル編集
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('contextmenu','mobile'); ← プラグインにmobileを追加

スキン追加(任意)

スキンを追加してユーザーインタフェース(見た目)を変更する。

LiteCube Free

LiteCube Freeを購入(無料)してダウンロード後、WinSCPでサーバーへアップロードする。

[root@localhost ~]# tar zxvf roundcube_plus_skin_litecube-f.tar.gz ← Litecube Free展開
[root@localhost ~]# mv plugins/xskin/ /var/www/roundcubemail/plugins/ ← Litecube Freeプラグイン(xskin)を所定のディレクトリへ移動
[root@localhost ~]# mv plugins/xframework/ /var/www/roundcubemail/plugins/ ← Litecube Freeプラグイン(xframework)を所定のディレクトリへ移動
[root@localhost ~]# mv skins/litecube-f/ /var/www/roundcubemail/skins/ ← Litecube Freeスキン(litecube-f)を所定のディレクトリへ移動
[root@localhost ~]# vi /var/www/roundcubemail/config/config.inc.php ← RoundCube Webmail設定ファイル編集
// ----------------------------------
// PLUGINS
// ----------------------------------
// List of active plugins (in plugins/ directory)
$config['plugins'] = array('contextmenu','xskin'); ← プラグインにxskinを追加

$config['skin'] = 'litecube-f'; ← スキン定義追加

$config['license_key'] = 'xxxxxxxxxx'; ← ライセンスキー定義追加※スキン購入ページで確認
[root@localhost ~]# rm -rf plugins/ skins/ README ← 展開後ディレクトリ削除
[root@localhost ~]# rm -f roundcube_plus_skin_litecube-f.tar.gz ← 展開前ファイル削除

RoundCube Webmailアップグレード

[root@localhost ~]# wget https://github.com/roundcube/roundcubemail/releases/download/1.3.4/roundcubemail-1.3.4-complete.tar.gz ← RoundCube Webmailダウンロード
※最新版のURLはダウンロードページで確認すること
[root@localhost ~]# tar zxvf roundcubemail-*-complete.tar.gz ← RoundCube Webmail展開
[root@localhost ~]# cd roundcubemail-* ← RoundCube Webmail展開先ディレクトリへ移動
[root@centos roundcubemail-1.3.4]# ./bin/installto.sh /var/www/roundcubemail/ ← RoundCube Webmailアップグレード
Upgrading from 1.1.4. Do you want to continue? (y/N) y ← y応答



All done.
[root@centos roundcubemail-1.3.4]# cd ← ホームディレクトリへ戻る
[root@localhost ~]# rm -rf roundcubemail-* ← RoundCube Webmail展開先ディレクトリを削除
[root@localhost ~]# /var/www/roundcubemail/bin/indexcontacts.sh ← アドレス帳インデックス更新

トップ   編集 凍結解除 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2019-10-28 (月) 22:39:15