試しの投稿
20170104-img_3827.jpg
変身忍者
今回のWebメールはRoundCubeで!(Ubuntu 16.04 LTS)

これらが事前にインストールし動いていること。
・SMTPサーバー、IMAPサーバー、PHP(今回はPHP5.6)、SSLの設定、MySQLサーバー

・データベースの作成
root@ubuntuez8:~# mysql -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 18331
Server version: 5.7.16-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2016, 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.

mysql> create database roundcube;
mysql> grant all privileges on roundcube.* to roundcube@'localhost' identified by 'password';
mysql> flush privileges;
mysql> exit

・RoundCubeのインストール
root@ubuntuez8:~# apt-get -y install roundcube roundcube-mysql roundcube-plugins roundcube-plugins-extra
Configuring roundcube-coreの設定が途中で表示されますがを選択して進めます。
root@ubuntuez8:~# cd /usr/share/dbconfig-common/data/roundcube/install
root@ubuntuez8:/usr/share/dbconfig-common/data/roundcube/install# mysql -u roundcube -D roundcube -p < mysql
root@ubuntuez8:/usr/share/dbconfig-common/data/roundcube/install# cd
root@ubuntuez8:~#

・RoundCubeの設定
root@ubuntuez8:~# vi /etc/roundcube/debian-db.php
<?php
##
## database access settings in php format
## automatically generated from /etc/dbconfig-common/roundcube.conf
## by /usr/sbin/dbconfig-generate-include
##
## by default this file is managed via ucf, so you shouldn't have to
## worry about manual changes being silently discarded. *however*,
## you'll probably also want to edit the configuration file mentioned
## above too.
##
$dbuser='roundcube';
$dbpass='password';
$basepath='';
$dbname='roundcube';
$dbserver='localhost';
$dbport='';
$dbtype='mysql';

root@ubuntuez8:~# vi /etc/roundcube/config.inc.php
省略
$config = array();
省略
$config['default_host'] = 'ssl://mail.hogehoge-net.com';
省略
$config['default_host'] = 'ssl://mail.hogehoge-net.com';
省略
$config['smtp_server'] = 'ssl://mail.hogehoge-net.com';
省略
$config['smtp_port'] = 465;
省略
$config['smtp_user'] = '%u';
省略
$config['smtp_pass'] = '%p';
省略
$config['product_name'] = 'HoGeHoGe-NET.COM. Webmail';

ここからは最後に追加
# IMAP Port specification (SSL)
$config['default_port'] = 993;

# SMTP Specify authentication type
$config['smtp_auth_type'] = 'LOGIN';

# SMTP HELO host Designation
$config['smtp_helo_host'] = 'hogehoge-net.com';

# Specify domain name
$config['mail_domain'] = 'hogehoge-net.com';

# UserAgent Specify
$config['useragent'] = 'HoGeHoGe-NET.COM. Webmail';

# SMTP IMAP Specify connection options
$config['imap_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'peer_name' => 'mail.hogehoge-net.com',
'allow_self_signed' => true,
'ciphers' => 'HIGH:!SSLv2:!SSLv3',
),
);
$config['smtp_conn_options'] = array(
'ssl' => array(
'verify_peer' => true,
'peer_name' => 'mail.hogehoge-net.com',
'allow_self_signed' => true,
'ciphers' => 'HIGH:!SSLv2:!SSLv3',
),
);

ここがpoint 'CN_match' ではなく 'peer_name' で!!

root@ubuntuez8:~# vi /etc/apache2/conf-enabled/roundcube.conf
#コメント解除
Alias /roundcube /var/lib/roundcube

php-mcryptの暗号化関数が必要。なのでインストールするが他にもいろいろ入れておく。
root@ubuntuez8:~# apt install php5.6-mcrypt php5.6-intl php5.6-zip

PHP拡張を有効化
root@ubuntuez8:~# phpenmod mcrypt

PEAR (PHP Extension and Application Repository)でPHPライブラリを確認
とりあえづ現状をアップデートしておく。
root@ubuntuez8:~# pear upgrade-all
でこんなのが必要なのでインストール
root@ubuntuez8:~# pear install Auth_SASL Net_SMTP Net_IDNA2-0.1.1 Mail_mime Mail_mimeDecode
root@ubuntuez8:~# pear list
Installed packages, channel pear.php.net:
==============
Package Version State
Archive_Tar 1.4.2 stable
Auth 1.6.4 stable
Auth_SASL 1.0.6 stable
Console_Getopt 1.4.1 stable
Crypt_CHAP 1.5.0 stable
DB 1.9.2 stable
Log 1.13.1 stable
MDB2 2.5.0b5 beta
Mail 1.3.0 stable
Mail_Mime 1.10.0 stable
Mail_mimeDecode 1.5.6 stable
Net_IDNA2 0.1.1 beta
Net_LDAP2 2.2.0 stable
Net_SMTP 1.7.2 stable
Net_Sieve 1.3.4 stable
Net_Socket 1.0.14 stable
PEAR 1.10.1 stable
PEAR_Manpages 1.10.0 stable
Structures_Graph 1.1.1 stable
XML_Util 1.3.0 stable
ここpointNet_IDNA2-0.1.1はバージョンも指定してインストール。ベータ版ですねこれ!!

pluginのjqueryuiとzipdownloadのconfigファイルを修正
root@ubuntuez8:~# cd /var/lib/roundcube/plugins/jqueryui
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# cat config.inc.php
<?php
// Empty configuration for jqueryui
// See /usr/share/roundcube/plugins/jqueryui/config.inc.php.dist for instructions
// Check the access right of the file if you put sensitive information in it.
?>
と書いてあるので!
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 23 2015 config.inc.php -> /etc/roundcube/plugins/jqueryui/config.inc.php
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# rm config.inc.php
root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ln -s config.inc.php.dist config.inc.php

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 30 09:25 config.inc.php -> config.inc.php.dist
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/jqueryui# cd /var/lib/roundcube/plugins/zipdownload
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# cat config.inc.php
<?php
// Empty configuration for zipdownload
// See /usr/share/roundcube/plugins/zipdownload/config.inc.php.dist for instructions
// Check the access right of the file if you put sensitive information in it.
?>
同じくと書いてあるので!
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 23 2015 config.inc.php -> /etc/roundcube/plugins/zipdownload/config.inc.php
ーrw-r--r-- 1 root root 334 Nov 23 2015 config.inc.php.dist

root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# rm config.inc.php
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ln -s config.inc.php.dist config.inc.php

root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# ls -al | grep config.inc.php
lrwxrwxrwx 1 root root 19 Nov 30 09:47 config.inc.php -> config.inc.php.dist
ーrw-r--r-- 1 root root 399 Nov 23 2015 config.inc.php.dist

apache2をリスタートして終了
root@ubuntuez8:/var/lib/roundcube/plugins/zipdownload# systemctl restart apache2.service

・これでWeb ブラウザを起動し、「https://www.hogehoge-net.com/roundcube/」でログインして使えますが、LOGをはくのでローテーションなんか設定しましょう。
gentooからubuntuにサーバを移行中。80%終了しました
これはバージョンアップですね。
[ebuild U ] net-misc/openssh-5.1_p1-r1 [4.7_p1-r6] USE="X kerberos pam tcpd -X509 -hpn -ldap -libedit (-selinux) -skey -smartcard -static (-chroot%)" 1,083 kB

ところでOpemOffice3.0のアップデートなんだけどビルドにすごい時間がかかります。
これ!
[ebuild U ] app-office/openoffice-3.0.0 [2.4.1] USE="cups dbus eds gnome gstreamer gtk java kde ldap opengl pam -debug -mono -nsplugin% -odk -templates% (-binfilter%) (-firefox%*) (-seamonkey%) (-xulrunner%)" LINGUAS="ja -af -ar -as_IN -be_BY -bg -bn -br -bs -ca -cs -cy -da -de -dz -el -en -en_GB -en_US -en_ZA -eo -es -et -fa -fi -fr -ga -gl -gu_IN -he -hi_IN -hr -hu -it -km -ko -ku -lt -lv -mk -ml_IN -mr_IN -nb -ne -nl -nn -nr -ns -or_IN -pa_IN -pl -pt -pt_BR -ru -rw -sh -sk -sl -sr -ss -st -sv -sw_TZ -ta_IN -te_IN -tg -th -ti_ER -tn -tr -ts -uk -ur_IN -ve -vi -xh -zh_CN -zh_TW -zu" 0 kB

ccacheにたくさんのJOBがありますね。キャッシュのパフォーマンスが悪いのかな?
mozilla-thunderbird,mozilla-firefoxのアップデートです。対応は素早くいきましょう 8-)

[ebuild U ] mail-client/mozilla-thunderbird-2.0.0.5 [2.0.0.4] USE="crypt gnome ipv6 ldap xinerama -bindist -debug -mozdom -moznopango -replytolist -xprint" LINGUAS="ja -be -bg -ca -cs -da -de -el -en_GB -es -es_AR -es_ES -eu -fi -fr -ga -ga_IE -hu -it -lt -mk -nb -nb_NO -nl -nn -nn_NO -pa -pa_IN -pl -pt -pt_BR -pt_PT -ru -sk -sl -sv -sv_SE -tr -zh -zh_CN -zh_TW" 36,781 kB
[ebuild U ] www-client/mozilla-firefox-2.0.0.5 [2.0.0.4] USE="gnome ipv6 java xinerama -bindist -debug -filepicker -mozdevelop -moznopango -restrict-javascript -xforms -xprint" LINGUAS="ja -af -ar -be -bg -ca -cs -da -de -el -en_GB -es -es_AR -es_ES -eu -fi -fr -fy -fy_NL -ga -ga_IE -gu -gu_IN -he -hu -it -ka -ko -ku -lt -mk -mn -nb -nb_NO -nl -nn -nn_NO -pa -pa_IN -pl -pt -pt_BR -pt_PT -ro -ru -sk -sl -sv -sv_SE -tr -zh -zh_CN -zh_TW" 36,706 kB
[ebuild U ] app-shells/bash-3.2_p17 [3.2_p15-r1] USE="nls -afs -bashlogger -vanilla" 5 kB
[ebuild U ] dev-libs/libcdio-0.78.2 [0.77] USE="nls -cddb -minimal -nocxx" 1,977 kB
[ebuild U ] sys-apps/hdparm-7.6 [7.5] 61 kB
spamassassin,imagemagickなどなど。

[ebuild N ] dev-util/re2c-0.12.0 596 kB
[ebuild U ] media-gfx/imagemagick-6.3.4-r1 [6.3.3] USE="X bzip2 fpx gs jpeg jpeg2k mpeg nocxx perl png tiff truetype wmf xml zlib -doc -graphviz -hdri% -jbig -lcms -openexr% -q32% -q8%" 5,678 kB
[ebuild U ] mail-filter/spamassassin-3.2.1-r1 [3.1.8-r1] USE="berkdb ipv6 ldap mysql postgres ssl -doc -qmail -sqlite -tools" 959 kB
BIND,clamavです。

[ebuild U ] media-libs/libgii-1.0.2 [0.9.0] USE="X" 685 kB
[ebuild U ] net-dns/bind-9.3.4-r3 [9.3.4-r2] USE="berkdb ipv6 ldap mysql postgres ssl -dlz -doc -idn -odbc -resolvconf (-selinux) -threads" 0 kB
[ebuild U ] app-antivirus/clamav-0.90.3 [0.90.2] USE="crypt curl milter nls -bzip2 -logrotate -mailwrapper (-selinux)" 12,204 kB
[ebuild U ] media-libs/libggi-2.2.2 [2.1.1] USE="X aalib directfb fbcon mmx svga -3dfx -debug (-vis)" 1,047 kB
Firefoxですね。こちらもWindowsと同様にアップデートです。だがコンパイルにすげー時間が掛かる。

[ebuild U ] www-client/mozilla-firefox-2.0.0.4 [2.0.0.3] USE="gnome ipv6 java xinerama -bindist -debug -filepicker -mozdevelop -moznopango -restrict-javascript -xforms -xprint" LINGUAS="ja -af -ar -be -bg -ca -cs -da -de -el -en_GB -es -es_AR -es_ES -eu -fi -fr -fy -fy_NL -ga -ga_IE -gu -gu_IN -he -hu -it -ka -ko -ku -lt -mk -mn -nb -nb_NO -nl -nn -nn_NO -pa -pa_IN -pl -pt -pt_BR -pt_PT -ro% -ru -sk -sl -sv -sv_SE -tr -zh -zh_CN -zh_TW" 36,636 kB
thunderbirdがバージョン2ですね。

[ebuild U ] mail-client/mozilla-thunderbird-2.0.0.0 [1.5.0.10] USE="crypt gnome ipv6 ldap xinerama -bindist% -debug -mozdom% -moznopango -replytolist% -xprint" LINGUAS="ja -be% -bg -ca -cs -da -de -el -en_GB -es -es_AR -es_ES -eu -fi -fr -ga -ga_IE -hu -it -lt -mk -nb -nb_NO -nl -pa% -pa_IN -pl -pt% -pt_BR -pt_PT% -ru -sk -sl -sv -sv_SE -tr -zh% -zh_CN -zh_TW% (-gu_IN%) (-he%) (-ko%)" 36,729 kB
[ebuild U ] x11-plugins/enigmail-0.95.0 [0.94.3] LINGUAS="ja -ca -de -el -es -es_ES -fi -fr -hu -it -nb -nb_NO -pl -pt -pt_BR -ru -sl -sv -zh_CN (-cs%) (-es_AR%) (-ko%) (-nl%) (-sk%) (-sv_SE%)" 589 kB
さぼっているとこんなことに!proftpd,samba,mysql,phpやら^^ゆっくりいきましょう。

[ebuild U ] dev-lang/python-2.4.4-r4 [2.4.4] USE="berkdb gdbm ipv6 ncurses readline ssl -bootstrap -build -doc -examples% -nocxx -nothreads% -tk -ucs2" 9 kB
[ebuild N ] virtual/libstdc++-3.3 0 kB
[ebuild U ] app-cdr/cdrtools-2.01.01_alpha25 [2.01.01_alpha10] USE="unicode" 1,554 kB
[ebuild U ] net-ftp/proftpd-1.3.1_rc2-r1 [1.3.1_rc2] USE="clamav ipv6 ldap mysql ncurses nls pam postgres ssl tcpd xinetd -acl -authfile -hardened -ifsession -noauthunix -opensslcrypt -radius -rewrite (-selinux) -shaper -sitemisc -softquota -vroot" 0 kB
[ebuild U ] app-crypt/gnupg-1.4.7-r1 [1.4.6] USE="curl ldap nls readline usb zlib -bindist -bzip2 -ecc -idea (-selinux) -smartcard -static (-X%*)" LINGUAS="-ru" 3,126 kB
[ebuild U ] media-libs/freetype-2.3.3 [2.1.10-r3] USE="X%* zlib -bindist -debug% -doc" 1,417 kB
[ebuild U ] net-fs/samba-3.0.24-r2 [3.0.24] USE="cups fam kerberos ldap pam python readline winbind -acl -async -automount -caps% -doc -examples -oav -quotas (-selinux) -swat -syslog" LINGUAS="ja -pl" 14 kB
[ebuild U ] sys-power/acpid-1.0.4-r5 [1.0.4-r4] USE="-doc -logrotate" 11 kB
[ebuild U ] dev-db/mysql-5.0.40 [5.0.38] USE="berkdb latin1 perl ssl -big-tables -cluster -debug -embedded -extraengine -max-idx-128 -minimal (-selinux) -static" 23,482 kB
[ebuild U ] dev-lang/php-5.2.2-r1 [5.2.1-r3] USE="apache2 berkdb cjk cli crypt curl gd gdbm iconv imap ipv6 kerberos ldap mysql mysqli ncurses nls pcre postgres readline reflection session spell spl ssl truetype unicode xml zlib -adabas -bcmath -birdstep -bzip2 -calendar -cdb -cgi -concurrentmodphp -ctype -curlwrappers -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -exif -fastbuild -fdftk -filter -firebird -flatfile -force-cgi-redirect -frontbase -ftp -gd-external -gmp -hash -inifile -interbase -iodbc -java-external -json -ldap-sasl -libedit -mcve -mhash -msql -mssql -oci8 -oci8-instant-client -odbc -pcntl -pdo -pdo-external -pic -posix -qdbm -recode -sapdb -sharedext -sharedmem -simplexml -snmp -soap -sockets -solid -sqlite -suhosin -sybase -sybase-ct -sysvipc -threads -tidy -tokenizer -wddx -xmlreader -xmlrpc -xmlwriter -xpm -xsl -yaz -zip -zip-external (-apache%)" 7,151 kB
[ebuild U ] sys-apps/util-linux-2.12r-r7 [2.12r-r6] USE="crypt nls perl -old-crypt (-selinux) -static" 0 kB
[ebuild U ] dev-lang/ruby-1.8.5_p2-r1 [1.8.5_p2] USE="cjk ipv6 -debug -doc -examples -socks5 -threads -tk" 211 kB
[ebuild U ] media-sound/banshee-0.12.1 [0.12.0] USE="encode mad vorbis -aac -boo -daap -debug -doc -flac -ipod -njb" 3,010 kB
[ebuild U ] sys-libs/timezone-data-2007e [2007d] USE="nls" 341 kB
[ebuild U ] x11-libs/cairo-1.4.6 [1.4.4] USE="X directfb -debug -doc -glitz -svg -xcb" 3,108 kB
[ebuild N ] app-admin/python-updater-0.2 3 kB
[ebuild NS ] dev-java/sun-jre-bin-1.6.0-r1 USE="X alsa -nsplugin" 61,249 kB