ライン

ポイント:*

ライン

 はじめに

 iRedMailの記事は見たことはありましたが、実際に試したことはありませんでした。
今回入れるのは、Open Source Editionで、-Proのディションではない方です。Proは、1年$499で3年だと$899/1台という値付け。
デモ画面を見ると、日本語には対応されていないもののそこそこの機能は持っている感じ。

少しだけ時間がありましたので試してみることにします。今回は、久々にFreeBSDを新規導入して試します。
FreeBSD 10.2-RELELASEをVMware上に入れてから開始します。

 手順

OSの導入

 では開始します。

 
 いろいろ省略しましたが、メモリー1GBでディスクは40GBという軽い感じの環境にしました。
ネットワークは、インターネットに直接さらした環境にしています。
 

インストールは問題なく完了。これまで通りという感じでした。
NTPやフィルター系を入れ終えて、ひとまずリブートして問題ないかを確認完了。

メールログに、

STARTTLS=server: file /etc/mail/certs/dh.param unsafe: No such file or directory

という記録が残っていました。

# cd /etc/mail/certs
# openssl dhparam -out dh.param 4096
# cd /etc/mail
# make restart

これで出なくなったことを確認できました。

iRedMail

 さて、ベースボールも終わり、フィギアスケートを見ている時間になって、やっと本題に入ることになりました。
多くのパッケージを入れると2GBのメモリーは欲しいようですが、ここはこのままで試してみます。

前提があるので、bashから入れます。

#pkg install bash-static
The package management tool is not yet installed on your system.
Do you want to fetch and install it now? [y/N]: y
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:10:amd64/quarterly, please wait...
Verifying signature with trusted certificate pkg.freebsd.org.2013102301... done
Installing pkg-1.6.1...
Extracting pkg-1.6.1: 100%
Message from pkg-1.6.1:
If you are upgrading from the old package format, first run:

  # pkg2ng
Updating FreeBSD repository catalogue...
Fetching meta.txz: 100%    940 B   0.9kB/s    00:01
Fetching packagesite.txz: 100%    5 MiB   1.1MB/s    00:05
Processing entries: 100%
FreeBSD repository update completed. 24632 packages processed.
Updating database digests format: 100%
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        bash-static: 4.3.42
        indexinfo: 0.2.3
        gettext-runtime: 0.19.5.1

The process will require 8 MiB more space.
2 MiB to be downloaded.

Proceed with this action? [y/N]: y
Fetching bash-static-4.3.42.txz: 100%    2 MiB 817.7kB/s    00:02
Fetching indexinfo-0.2.3.txz: 100%    5 KiB   5.0kB/s    00:01
Fetching gettext-runtime-0.19.5.1.txz: 100%  147 KiB 150.4kB/s    00:01
Checking integrity... done (0 conflicting)
[1/3] Installing indexinfo-0.2.3...
[1/3] Extracting indexinfo-0.2.3: 100%
[2/3] Installing gettext-runtime-0.19.5.1...
[2/3] Extracting gettext-runtime-0.19.5.1: 100%
[3/3] Installing bash-static-4.3.42...
[3/3] Extracting bash-static-4.3.42: 100%
Message from bash-static-4.3.42:
======================================================================

bash requires fdescfs(5) mounted on /dev/fd

If you have not done it yet, please do the following:

        mount -t fdescfs fdesc /dev/fd

To make it permanent, you need the following lines in /etc/fstab:

        fdesc   /dev/fd         fdescfs         rw      0       0

======================================================================

本体は、pkgでは入らないみたいなので、直接パッケージを取りに行きます。

fetchで持ってこようと思ったらエラーになるみたい。

#fetch https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.2.tar.bz2
Certificate verification failed for /C=US/O=DigiCert Inc/OU=www.digicert.com/CN=DigiCert SHA2 Extended Validation Server CA
34380974616:error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed:/usr/src/secure/lib/libssl/../../../crypto/openssl/ssl/s3_clnt.c:1185:
fetch: https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.2.tar.bz2: Authentication error

あれ、ダメなんだっけ。調べて、

#fetch --no-verify-peer https://bitbucket.org/zhb/iredmail/downloads/iRedMail-0.9.2.tar.bz2
iRedMail-0.9.2.tar.bz2                        100% of  121 kB  182 kBps 00m01s

入手完了。

#tar xjvf iRedMail-0.9.2.tar.bz2

展開問題なし。

#cd iRedMail-0.9.2/
#ll
total 100
-rw-r--r--   1 501  staff  55610 Jul 27 10:39 ChangeLog
-rw-r--r--   1 501  staff    889 Jul 27 10:39 Documentations
-rw-r--r--   1 501  staff    725 Jul 27 10:40 README.md
drwxr-xr-x   2 501  staff    512 Oct 15 21:56 conf/
drwxr-xr-x   2 501  staff    512 Sep  3 11:34 dialog/
drwxr-xr-x   2 501  staff   1024 Oct 16 12:56 functions/
-rw-r--r--   1 501  staff   4955 Jul 27 10:40 iRedMail.sh
drwxr-xr-x   3 501  staff    512 Jul 27 10:40 patches/
drwxr-xr-x   2 501  staff    512 Sep  2 23:16 pkgs/
drwxr-xr-x  16 501  staff    512 Jul 27 10:41 samples/
drwxr-xr-x   2 501  staff    512 Jul 27 10:41 tools/
#bash ./iRedMail.sh

導入を開始します。
※/etc/rc.conf のhostname の部分は、FQDNで記述されていることが前提になっています

 
 
 デフォルトとを曲げてApacheにしました。
 
 MariaDBでもいいし、OpenLDAPでもよさげ。最近触っているし、折角なのでOpenLDAPにしました。
 
 
 
 ん?結局MySQLも必要だったんだっけ?
 
 
 
 

この後は依存するパッケージがどんどん追加されていきます。
OS導入後で、Perl5すら入っていない環境だったので、すごい勢いで追加されていきました。
今回は、評価用の環境なので、何が入っても良いです。特に何も答えなくても入っていくので軽快です。
しかしなるほどメモリーが2GBは欲しいのかなぁ…という数のデーモンが動きそうです。

眺めていると、無駄に類似するものだったりバージョン違いのものも加わっている気がします。
流れで眺めていると、pkg infoで見えてこないので、まだ加わっていない状態??
途中から、portsで入れる動きになってきました。すごいなって思ってしまう。いや、pkgで入る物はそっちで入れて欲しいな…。
これ全部portsで入れるのかな。

Oct 25 23:32:08 mail pkg-static: pkgconf-0.9.12_1 installed
Oct 25 23:32:34 mail pkg-static: expat-2.1.0_3 installed
Oct 25 23:35:41 mail pkg-static: gettext-tools-0.19.6 installed
Oct 25 23:35:51 mail pkg-static: libffi-3.2.1 installed
Oct 25 23:37:33 mail pkg-static: python27-2.7.10_1 installed
Oct 25 23:37:42 mail pkg-static: py27-setuptools27-17.0 installedps aux
Oct 25 23:37:45 mail pkg-static: py27-MarkupSafe-0.23 installed
Oct 25 23:37:59 mail pkg-static: py27-pytz-2015.4,1 installed
Oct 25 23:38:02 mail pkg-static: py27-Babel-2.0 installed
Oct 25 23:38:04 mail pkg-static: py27-Jinja2-2.8 installed
Oct 25 23:38:39 mail pkg-static: gmake-4.1_2 installed
Oct 25 23:39:42 mail pkg-static: libxml2-2.9.2_3 installed
Oct 25 23:39:59 mail pkg-static: libgpg-error-1.20 installed
Oct 25 23:40:29 mail pkg-static: libgcrypt-1.6.3 installed
Oct 25 23:40:49 mail pkg-static: libxslt-1.1.28_7 installed
Oct 25 23:41:41 mail pkg-static: py27-lxml-3.4.1_1 installed
Oct 25 23:41:48 mail pkg-static: py27-netifaces-0.10.4 installed
Oct 25 23:41:52 mail pkg-static: py27-beautifulsoup-4.3.2 installed
Oct 25 23:41:54 mail pkg-static: py27-bcrypt-0.4_2 installed
Oct 25 23:42:40 mail pkg-static: gdbm-1.11_2 installed
Oct 25 23:48:27 mail pkg-static: perl5-5.20.3_8 installed
Oct 25 23:48:57 mail pkg-static: cyrus-sasl-2.1.26_12 installed
Oct 25 23:50:18 mail pkg-static: openldap-sasl-client-2.4.42_2 installed
Oct 25 23:50:35 mail pkg-static: libltdl-2.4.6 installed
Oct 25 23:53:56 mail pkg-static: db5-5.3.28_2 installed
Oct 25 23:56:19 mail pkg-static: openldap-sasl-server-2.4.42_2 installed
Oct 25 23:58:02 mail pkg-static: py27-docutils-0.12 installed
Oct 25 23:58:06 mail pkg-static: py27-six-1.9.0 installed
Oct 25 23:58:22 mail pkg-static: py27-pygments-2.0.2 installed
Oct 25 23:58:29 mail pkg-static: py27-sphinx_rtd_theme-0.1.8 installed
Oct 25 23:58:31 mail pkg-static: py27-alabaster-0.7.6 installed
Oct 25 23:58:39 mail pkg-static: py27-pystemmer-1.3.0_1 installed
Oct 25 23:58:40 mail pkg-static: py27-snowballstemmer-1.2.0_1 installed
Oct 25 23:58:47 mail pkg-static: py27-sphinx-1.3.1_2 installed
Oct 25 23:59:13 mail pkg-static: libssh2-1.6.0_1,2 installed
Oct 26 00:00:36 mail pkg-static: ca_root_nss-3.20 installed
Oct 26 00:00:40 mail pkg-static: curl-7.45.0 installed
Oct 26 00:00:44 mail pkg-static: python2-2_3 installed
Oct 26 00:00:56 mail pkg-static: libsigsegv-2.10_1 installed
Oct 26 00:01:23 mail pkg-static: m4-1.4.17_1,1 installed
Oct 26 00:01:27 mail pkg-static: scons-2.3.0_1 installed
Oct 26 00:01:40 mail pkg-static: jsoncpp-0.6.0.r2_2 installed
Oct 26 00:02:27 mail pkg-static: lzo2-2.09 installed
Oct 26 00:03:22 mail pkg-static: libarchive-3.1.2_4,1 installed
Oct 25 23:32:08 mail pkg-static: pkgconf-0.9.12_1 installed
Oct 25 23:32:34 mail pkg-static: expat-2.1.0_3 installed
Oct 25 23:35:41 mail pkg-static: gettext-tools-0.19.6 installed
Oct 25 23:35:51 mail pkg-static: libffi-3.2.1 installed
Oct 25 23:37:33 mail pkg-static: python27-2.7.10_1 installed
Oct 25 23:37:42 mail pkg-static: py27-setuptools27-17.0 installed
Oct 25 23:37:45 mail pkg-static: py27-MarkupSafe-0.23 installed
Oct 25 23:37:59 mail pkg-static: py27-pytz-2015.4,1 installed
Oct 25 23:38:02 mail pkg-static: py27-Babel-2.0 installed
Oct 25 23:38:04 mail pkg-static: py27-Jinja2-2.8 installed
Oct 25 23:38:39 mail pkg-static: gmake-4.1_2 installed
Oct 25 23:39:42 mail pkg-static: libxml2-2.9.2_3 installed
Oct 25 23:39:59 mail pkg-static: libgpg-error-1.20 installed
Oct 25 23:40:29 mail pkg-static: libgcrypt-1.6.3 installed
Oct 25 23:40:49 mail pkg-static: libxslt-1.1.28_7 installed
Oct 25 23:41:41 mail pkg-static: py27-lxml-3.4.1_1 installed
Oct 25 23:41:48 mail pkg-static: py27-netifaces-0.10.4 installed
Oct 25 23:41:52 mail pkg-static: py27-beautifulsoup-4.3.2 installed
Oct 25 23:41:54 mail pkg-static: py27-bcrypt-0.4_2 installed
Oct 25 23:42:40 mail pkg-static: gdbm-1.11_2 installed
Oct 25 23:48:27 mail pkg-static: perl5-5.20.3_8 installed
Oct 25 23:48:57 mail pkg-static: cyrus-sasl-2.1.26_12 installed
Oct 25 23:50:18 mail pkg-static: openldap-sasl-client-2.4.42_2 installed
Oct 25 23:50:35 mail pkg-static: libltdl-2.4.6 installed
Oct 25 23:53:56 mail pkg-static: db5-5.3.28_2 installed
Oct 25 23:56:19 mail pkg-static: openldap-sasl-server-2.4.42_2 installed
Oct 25 23:58:02 mail pkg-static: py27-docutils-0.12 installed
Oct 25 23:58:06 mail pkg-static: py27-six-1.9.0 installed
Oct 25 23:58:22 mail pkg-static: py27-pygments-2.0.2 installed
Oct 25 23:58:29 mail pkg-static: py27-sphinx_rtd_theme-0.1.8 installed
Oct 25 23:58:31 mail pkg-static: py27-alabaster-0.7.6 installed
Oct 25 23:58:39 mail pkg-static: py27-pystemmer-1.3.0_1 installed
Oct 25 23:58:40 mail pkg-static: py27-snowballstemmer-1.2.0_1 installed
Oct 25 23:58:47 mail pkg-static: py27-sphinx-1.3.1_2 installed
Oct 25 23:59:13 mail pkg-static: libssh2-1.6.0_1,2 installed
Oct 26 00:00:36 mail pkg-static: ca_root_nss-3.20 installed
Oct 26 00:00:40 mail pkg-static: curl-7.45.0 installed
Oct 26 00:00:44 mail pkg-static: python2-2_3 installed
Oct 26 00:00:56 mail pkg-static: libsigsegv-2.10_1 installed
Oct 26 00:01:23 mail pkg-static: m4-1.4.17_1,1 installed
Oct 26 00:01:27 mail pkg-static: scons-2.3.0_1 installed
Oct 26 00:01:40 mail pkg-static: jsoncpp-0.6.0.r2_2 installed
Oct 26 00:02:27 mail pkg-static: lzo2-2.09 installed
Oct 26 00:03:22 mail pkg-static: libarchive-3.1.2_4,1 installed
Oct 26 00:14:30 mail pkg-static: cmake-modules-3.3.1 installed
Oct 26 00:14:47 mail pkg-static: cmake-3.3.1 installed
Oct 26 00:15:53 mail pkg-static: libedit-3.1.20150325_1 installed
Oct 26 00:17:22 mail pkg-static: mysql56-client-5.6.26 installed
Oct 26 00:34:08 mail pkg-static: mysql56-server-5.6.26 installed
Oct 26 00:38:17 mail pkg-static: dovecot2-2.2.19 installed
Oct 26 00:39:21 mail pkg-static: p5-CPAN-Meta-2.150005 installed
Oct 26 00:39:24 mail pkg-static: p5-Module-Build-0.4214 installed
Oct 26 00:39:30 mail pkg-static: p5-Encode-Detect-1.01_1 installed
Oct 26 00:39:35 mail pkg-static: p5-HTML-Tagset-3.20_1 installed
Oct 26 00:39:40 mail pkg-static: p5-HTML-Parser-3.71_1 installed
Oct 26 00:39:45 mail pkg-static: p5-HTTP-Date-6.02_1 installed
Oct 26 00:39:50 mail pkg-static: p5-Socket-2.020 installed
Oct 26 00:39:54 mail pkg-static: p5-IO-Socket-IP-0.37 installed
Oct 26 00:39:58 mail pkg-static: p5-Digest-HMAC-1.03_1 installed
Oct 26 00:40:23 mail pkg-static: libidn-1.31 installed
Oct 26 00:40:26 mail pkg-static: p5-Net-LibIDN-0.12_4 installed
Oct 26 00:40:31 mail pkg-static: p5-Socket6-0.25_2 installed
Oct 26 00:40:33 mail pkg-static: p5-IO-Socket-INET6-2.72_1 installed
Oct 26 00:40:40 mail pkg-static: p5-Net-DNS-1.02 installed
Oct 26 00:40:58 mail pkg-static: p5-NetAddr-IP-4.075 installed
Oct 26 00:41:36 mail pkg-static: re2c-0.14.3 installed
Oct 26 00:41:47 mail pkg-static: p5-Net-SSLeay-1.72 installed
Oct 26 00:41:50 mail pkg-static: p5-Mozilla-CA-20141217 installed
Oct 26 00:41:53 mail pkg-static: p5-URI-1.69 installed
Oct 26 00:41:57 mail pkg-static: p5-IO-Socket-SSL-2.016 installed
Oct 26 00:42:36 mail pkg-static: gnupg1-1.4.19 installed
Oct 26 00:42:40 mail pkg-static: spamassassin-3.4.1_4 installed
Oct 26 00:42:54 mail pkg-static: p5-Unix-Syslog-1.1_1 installed
Oct 26 00:42:58 mail pkg-static: p5-Convert-BinHex-1.124 installed
Oct 26 00:43:02 mail pkg-static: p5-TimeDate-2.30_2,1 installed
Oct 26 00:43:06 mail pkg-static: p5-Mail-Tools-2.14 installed
Oct 26 00:43:10 mail pkg-static: p5-MIME-Tools-5.507,2 installed
Oct 26 00:43:13 mail pkg-static: p5-IO-stringy-2.111 installed
Oct 26 00:43:17 mail pkg-static: p5-Convert-TNEF-0.18_1 installed
Oct 26 00:43:20 mail pkg-static: p5-Canary-Stability-2006 installed
Oct 26 00:43:27 mail pkg-static: p5-Convert-UUlib-1.50,1 installed
Oct 26 00:43:30 mail pkg-static: p5-Archive-Zip-1.53 installed
Oct 26 00:43:34 mail pkg-static: p5-IO-Multiplex-1.13_1 installed
Oct 26 00:43:37 mail pkg-static: p5-Net-Server-2.008_1 installed
Oct 26 00:43:43 mail pkg-static: p5-Crypt-OpenSSL-Bignum-0.06 installed
Oct 26 00:43:46 mail pkg-static: p5-Crypt-OpenSSL-Random-0.11 installed
Oct 26 00:43:49 mail pkg-static: p5-Crypt-OpenSSL-RSA-0.28_1 installed
Oct 26 00:43:52 mail pkg-static: p5-Mail-DKIM-0.40_2 installed
Oct 26 00:43:56 mail pkg-static: p5-Crypt-CBC-2.33_1 installed
Oct 26 00:44:00 mail pkg-static: p5-Crypt-DES-2.07_1 installed
Oct 26 00:44:04 mail pkg-static: p5-Digest-SHA1-2.13_1 installed
Oct 26 00:44:08 mail pkg-static: p5-Net-SNMP-6.0.1_1 installed
Oct 26 00:44:14 mail pkg-static: p5-BerkeleyDB-0.55 installed
Oct 26 00:44:24 mail pkg-static: p5-DBI-1.634 installed
Oct 26 00:44:57 mail pkg-static: p5-DBD-SQLite-1.48 installed
Oct 26 00:45:03 mail pkg-static: p5-DBD-mysql-4.032 installed
Oct 26 00:45:09 mail pkg-static: p5-GSSAPI-0.28_1 installed
Oct 26 00:45:12 mail pkg-static: p5-Authen-SASL-2.16_1 installed
Oct 26 00:45:15 mail pkg-static: p5-Convert-ASN1-0.27_2 installed
Oct 26 00:45:18 mail pkg-static: p5-XML-SAX-Base-1.08_1 installed
Oct 26 00:45:22 mail pkg-static: p5-XML-NamespaceSupport-1.11_1 installed
Oct 26 00:45:25 mail pkg-static: p5-XML-SAX-0.99_2 installed
Oct 26 00:45:30 mail pkg-static: p5-XML-Filter-BufferText-1.01_1 installed
Oct 26 00:45:32 mail pkg-static: p5-XML-SAX-Writer-0.56 installed
Oct 26 00:45:37 mail pkg-static: p5-perl-ldap-0.6500 installed
Oct 26 00:45:43 mail pkg-static: p0f-3.08b_1 installed
Oct 26 00:45:47 mail pkg-static: altermime-0.3.11.a1 installed
Oct 26 00:45:57 mail pkg-static: file-5.22 installed
Oct 26 00:46:03 mail pkg-static: compat9x-amd64-9.2.902000.201310 installed
Oct 26 00:46:04 mail pkg-static: rar-5.2.1,3 installed
Oct 26 00:46:19 mail pkg-static: unrar-5.30,5 installed
Oct 26 00:46:24 mail pkg-static: p5-Locale-gettext-1.06 installed
Oct 26 00:46:35 mail pkg-static: gmake-lite-4.1_1 installed
Oct 26 00:46:39 mail pkg-static: help2man-1.43.3_1 installed
Oct 26 00:46:49 mail pkg-static: autoconf-wrapper-20131203 installed
Oct 26 00:46:50 mail pkg-static: autoconf-2.69 installed
Oct 26 00:47:06 mail pkg-static: arj-3.10.22_4 installed
Oct 26 00:47:08 mail pkg-static: unarj-2.65_2 installed
Oct 26 00:47:12 mail pkg-static: lha-1.14i_6 installed
Oct 26 00:47:16 mail pkg-static: arc-5.21p installed
Oct 26 00:47:18 mail pkg-static: nomarch-1.4 installed
Oct 26 00:47:23 mail pkg-static: cabextract-1.6 installed
Oct 26 00:47:25 mail pkg-static: rpm2cpio-1.3_2 installed
Oct 26 00:47:29 mail pkg-static: zoo-2.10.1_3 installed
Oct 26 00:47:31 mail pkg-static: unzoo-4.4_2 installed
Oct 26 00:47:42 mail pkg-static: lzop-1.03 installed
Oct 26 00:47:46 mail pkg-static: freeze-2.5_2 installed
Oct 26 00:50:13 mail pkg-static: p7zip-9.38.1_2 installed
Oct 26 00:50:15 mail pkg-static: ripole-0.2.2 installed
Oct 26 00:50:20 mail pkg-static: tnef-1.4.11 installed
Oct 26 00:50:22 mail pkg-static: amavisd-new-2.10.1_1,1 installed
Oct 26 00:50:44 mail pkg-static: tinycdb-0.78_2 installed
Oct 26 00:50:49 mail pkg-static: lmdb-0.9.16 installed
Oct 26 00:52:30 mail pkg-static: pcre-8.37_4 installed
Oct 26 00:53:26 mail pkg-static: postfix-2.11.7,1 installed
Oct 26 00:53:59 mail pkg-static: automake-wrapper-20131203 installed
Oct 26 00:54:00 mail pkg-static: automake-1.15_1 installed
Oct 26 00:54:10 mail pkg-static: libtool-2.4.6 installed
Oct 26 00:55:21 mail pkg-static: apr-1.5.2.1.5.4 installed
Oct 26 00:57:19 mail pkg-static: apache24-2.4.17 installed
Oct 26 01:00:19 mail pkg-static: php55-5.5.30 installed
Oct 26 01:02:50 mail pkg-static: mod_php55-5.5.30 installed
Oct 26 01:03:32 mail pkg-static: cclient-2007f_2,1 installed
Oct 26 01:03:36 mail kernel: pid 6156 (conftest), uid 0: exited on signal 11 (core dumped) <== ?!
Oct 26 01:03:40 mail pkg-static: php55-imap-5.5.30 installed
Oct 26 01:04:05 mail pkg-static: php55-zip-5.5.30 installed
Oct 26 01:04:14 mail pkg-static: php55-bz2-5.5.30 installed
Oct 26 01:04:24 mail pkg-static: php55-zlib-5.5.30 installed
Oct 26 01:04:35 mail pkg-static: php55-gettext-5.5.30 installed
Oct 26 01:04:58 mail pkg-static: oniguruma4-4.7.1_1 installed
Oct 26 01:05:21 mail pkg-static: php55-mbstring-5.5.30 installed
Oct 26 01:05:50 mail pkg-static: libmcrypt-2.5.8_3 installed
Oct 26 01:05:55 mail pkg-static: php55-mcrypt-5.5.30 installed
Oct 26 01:06:07 mail pkg-static: php55-openssl-5.5.30 installed
Oct 26 01:06:17 mail pkg-static: php55-session-5.5.30 installed
Oct 26 01:06:26 mail pkg-static: php55-ctype-5.5.30 installed
Oct 26 01:06:40 mail pkg-static: php55-hash-5.5.30 installed
Oct 26 01:07:11 mail pkg-static: libiconv-1.14_9 installed
Oct 26 01:07:17 mail pkg-static: php55-iconv-5.5.30 installed
Oct 26 01:08:39 mail pkg-static: aspell-0.60.6.1_5 installed
Oct 26 01:08:45 mail pkg-static: php55-pspell-5.5.30 installed
Oct 26 01:09:03 mail pkg-static: php55-dom-5.5.30 installed
Oct 26 01:09:14 mail pkg-static: php55-xml-5.5.30 installed
Oct 26 01:09:24 mail pkg-static: php55-ldap-5.5.30 installed
Oct 26 01:09:34 mail pkg-static: php55-mysql-5.5.30 installed
Oct 26 01:09:46 mail pkg-static: php55-mysqli-5.5.30 installed
Oct 26 01:09:48 mail pkg-static: p5-Exporter-Tiny-0.042_1 installed
Oct 26 01:09:52 mail pkg-static: p5-Net-CIDR-0.18 installed
Oct 26 01:09:55 mail pkg-static: p5-Config-IniFiles-2.88 installed
Oct 26 01:09:58 mail pkg-static: p5-Cache-FastMmap-1.40_1 installed
Oct 26 01:10:15 mail pkg-static: php55-pdo-5.5.30 installed
Oct 26 01:10:21 mail pkg-static: php55-pdo_mysql-5.5.30 installed
Oct 26 01:10:22 mail pkg-static: policyd2-2.0.14_1 installed
Oct 26 01:11:01 mail pkg-static: libcheck-0.10.0 installed
Oct 26 01:13:06 mail pkg-static: clamav-0.98.7 installed
Oct 26 01:13:28 mail pkg-static: php55-json-5.5.30 installed
Oct 26 01:24:46 mail pkg-static: icu-55.1 installed
Oct 26 01:25:18 mail pkg-static: pecl-intl-3.0.0_2 installed
Oct 26 01:25:30 mail pkg-static: php55-filter-5.5.30 installed
Oct 26 01:25:40 mail pkg-static: php55-simplexml-5.5.30 installed
Oct 26 01:25:52 mail pkg-static: roundcube-1.1.3_1,1 installed
Oct 26 01:26:11 mail pkg-static: pear-1.9.4_3 installed
Oct 26 01:26:15 mail pkg-static: pear-Net_LDAP2-2.0.12,1 installed
Oct 26 01:26:25 mail pkg-static: p5-Net-XWhois-0.90_5 installed
Oct 26 01:26:27 mail pkg-static: p5-Net-IP-1.26_1 installed
Oct 26 01:26:32 mail pkg-static: awstats-7.4,1 installed

この先でこけました。

...
===>  Installing for awstats-7.4,1
===>  Checking if awstats already installed
===>   awstats-7.4,1 is already installed
      You may wish to ``make deinstall'' and install this port again
      by ``make reinstall'' to upgrade it properly.
      If you really wish to overwrite the old port of awstats
      without deleting it first, set the variable "FORCE_PKG_REGISTER"
      in your environment or the "make install" command line.
*** Error code 1

Stop.
make: stopped in /usr/ports/www/awstats
<< ERROR >> Port was not successfully installed, please fix it manually and then re-execute this script.

この後にfail2banとiredadminと続くはずなのに。時々、この手はあるのでこのままリラン。
続けると、

/root/iRedMail-0.9.2/functions/packages_freebsd.sh: line 1031: cd: /usr/ports/net/py-ldap2: No such file or directory
make: don't know how to make clean. Stop

make: stopped in /root/iRedMail-0.9.2
<< ERROR >> Port was not successfully installed, please fix it manually and then re-execute this script.

とかいってる。py-ldap2をpy-ldapに変更すれば良さそうだ。portsのネーミング変更タイミングだったようです。
./functions/packages_freebsd.shを3カ所か修正。再実行で続きから実行してくれるので先に進める。

*************************************************************************
* iRedMail-0.9.2 installation and configuration complete.
*************************************************************************

[ INFO ] Updating SpamAssassin rules (sa-update), please wait ...
[ INFO ] Compiling SpamAssassin rulesets (sa-compile), please wait ...
[ INFO ] Updating ClamAV database (freshclam), please wait ...
ClamAV update process started at Sat Oct 31 20:31:22 2015
nonblock_connect: connect timing out (30 secs)
Can't connect to port 80 of host database.clamav.net (IP: 203.178.137.175)
Trying host database.clamav.net (219.94.128.99)...
Downloading main.cvd [100%]
main.cvd updated (version: 55, sigs: 2424225, f-level: 60, builder: neo)
Downloading daily.cvd [100%]
daily.cvd updated (version: 21031, sigs: 1645560, f-level: 63, builder: neo)
Downloading bytecode.cvd [100%]
bytecode.cvd updated (version: 269, sigs: 47, f-level: 63, builder: anvilleg)
Database updated (4069832 signatures) from database.clamav.net (IP: 219.94.128.99)
WARNING: Clamd was NOT notified: Can't connect to clamd through /var/run/clamav/clamd.sock: No such file or directory
********************************************************************
* URLs of installed web applications:
*
* - Webmail:
*   o Roundcube webmail: httpS://mail.exmaple.com/mail/
*
* - Web admin panel (iRedAdmin): httpS://mail.exmaple.com/iredadmin/
*
* You can login to above links with same credential:
*
*   o Username: postmaster@exmaple.com
*   o Password: PASSOWORD
*
*
********************************************************************
* Congratulations, mail server setup completed successfully. Please
* read below file for more information:
*
*   - /root/iRedMail-0.9.2/iRedMail.tips
*
* And it's sent to your mail account postmaster@exmaple.com.
*
********************* WARNING **************************************
*
* Rebooting your system is required to enable mail services.
*
********************************************************************

再起動しろということなので、実施してみる。
これはまたいろいろなサービス動作しているな。ウェブからSSL通信でログインしてみる。
言語は、日本語はないので、英語でいいや…なるほど。これは便利かも。
ウェブメールは、roundcubeなので日本語になっていました。普通に便利に使えます。
メールサーバを勝手に準備してくれちゃった、という感じですね。

いろんなパッケージの設定方法を見るだけでも価値はありそうです。
ちゃんとOpenLDAPで使えるようになっているし。
各設定されているアカウントのパスワードなどは管理者宛の電子メールが来ていて、書かれていました。
ちょっと遊んでみようかと思います。

 眺めてみる

別サーバに導入

 なんとなく使い方などは分かってきたので、評価機は停止して手元のローカル環境で再構築してみました。
今回は、Apacheではなく元々のNginxにしてみました。以前PHP5の連動で苦戦したものの、このパッケージであれば綺麗に入るでしょうし。

 パッケージの導入前にPerl5やgmakeなど時間がかかりそうなものは先に pkgで入れておきましたが、どうやらツールはすべて取ってくるみたいです。
適当に待っていたらインストールは終わっていました。今度はローカルの環境なので、フィルタもかけずままでのんびり眺められます。
 初回のリブートを行って眺めてみることにします。
最初に送られてくるメールは以下のようなもの。どのようなパスワードになっているかなどの情報が出ています。

Admin of domain mail.fkimura.xyz:
     * Account: postmaster@mail.example.net
     * Password: password

     You can login to iRedAdmin with this account, login name is full email address.

 First mail user:
     * Username: postmaster@mail.example.net
     * Password: password
     * SMTP/IMAP auth type: login
     * Connection security: STARTTLS or SSL/TLS

     You can login to webmail with this account, login name is full email address.


 SSL cert keys (size: 2048):
     - /etc/ssl/certs/iRedMail.crt
     - /etc/ssl/private/iRedMail.key

 Mail Storage:
     - Root directory: /var/vmail
     - Mailboxes: /var/vmail/vmail1
     - Backup scripts and copies: /var/vmail/backup

 Nginx:
     * Configuration files:
         - /usr/local/etc/nginx/nginx.conf
         - /usr/local/etc/nginx/conf.d/default.conf
     * Directories:
         - /usr/local/etc/nginx
         - /usr/local/www/apache24/data
     * See also:
         - /usr/local/www/apache24/data/index.html

 php-fpm:
     * Configuration files:
         - /usr/local/etc/php-fpm.conf
     * Socket: /var/run/php-fpm.socket

 uWSGI:
     * Configuration files:
         - /usr/local/etc/uwsgi
     * Socket for iRedAdmin: /var/run/uwsgi_iredadmin.socket
 PHP:
     * PHP config file for Apache: /usr/local/etc/php.ini (not exist if you're running Nginx)
     * PHP config file for Nginx:  (not exist if you're running Apache)
     * Disabled functions: 

 OpenLDAP:
     * LDAP suffix: dc=example,dc=net
     * LDAP root dn: cn=Manager,dc=example,dc=net, password: password
     * LDAP bind dn (read-only): cn=vmail,dc=example,dc=net, password: JPOMbUhksmUsb5hZvngiMit8pEc428
     * LDAP admin dn (read-write): cn=vmailadmin,dc=example,dc=net, password: EFk5kBDG66gFXfiIgG730RdtDJ4nL8
     * LDAP base dn: o=domains,dc=example,dc=net
     * LDAP admin base dn: o=domainAdmins,dc=example,dc=net
     * Configuration files:
         - /usr/local/etc/openldap
         - /usr/local/etc/openldap/slapd.conf
         - /usr/local/etc/openldap/ldap.conf
         - /usr/local/etc/openldap/schema/iredmail.schema
     * Log file related:
         - /etc/syslog.conf
         - /var/log/openldap.log
         - /usr/local/etc/logrotate.d/openldap
     * Data dir and files:
         - /var/db/openldap-data
         - /var/db/openldap-data/example.net
         - /var/db/openldap-data/example.net/DB_CONFIG
     * RC script:
         - /usr/local/etc/rc.d/slapd
     * See also:
         - /root/iRedMail-0.9.2/runtime/ldap_init.ldif

 Backup OpenLDAP data:
     * Script: /var/vmail/backup/backup_openldap.sh
     * See also:
         # crontab -l -u root

 MySQL:
     * Root user: root, Password: password
     * Bind account (read-only):
         - Username: vmail, Password: T3ETgiun7GPNY3boeGWc4z34n10Opx
     * Vmail admin account (read-write):
         - Username: vmailadmin, Password: rRxvIxvSVwTAjPoVTlI6PJKxjDQTyX
     * RC script: /usr/local/etc/rc.d/mysql-server
     * See also:
         - /root/iRedMail-0.9.2/runtime/mysql_init.sql

 Backup MySQL database:
     * Script: /var/vmail/backup/backup_mysql.sh
     * See also:
         # crontab -l -u root
 Postfix (basic):
     * Configuration files:
         - /usr/local/etc/postfix
         - /usr/local/etc/postfix/aliases
         - /usr/local/etc/postfix/main.cf
         - /usr/local/etc/postfix/master.cf

 Postfix (LDAP):
     * Configuration files:
         - /usr/local/etc/postfix/ldap/virtual_mailbox_domains.cf
         - /usr/local/etc/postfix/ldap/relay_domains.cf
         - /usr/local/etc/postfix/ldap/transport_maps_domain.cf
         - /usr/local/etc/postfix/ldap/transport_maps_user.cf
         - /usr/local/etc/postfix/ldap/virtual_mailbox_maps.cf
         - /usr/local/etc/postfix/ldap/sender_login_maps.cf
         - /usr/local/etc/postfix/ldap/virtual_alias_maps.cf
         - /usr/local/etc/postfix/ldap/virtual_group_maps.cf
         - /usr/local/etc/postfix/ldap/virtual_group_members_maps.cf
         - /usr/local/etc/postfix/ldap/catchall_maps.cf
         - /usr/local/etc/postfix/ldap/recipient_bcc_maps_domain.cf
         - /usr/local/etc/postfix/ldap/recipient_bcc_maps_user.cf
         - /usr/local/etc/postfix/ldap/sender_bcc_maps_domain.cf
         - /usr/local/etc/postfix/ldap/sender_bcc_maps_user.cf

 Policyd (cluebringer):
     * Web UI:
         - URL: httpS://iRedMail.example.net/cluebringer/
         - Username: postmaster@mail.example.net
         - Password: password
     * Configuration files:
         - /usr/local/etc/cluebringer.conf
         - /cluebringer.conf
     * RC script:
         - /usr/local/etc/rc.d/cluebringer
     * Database:
         - Database name: cluebringer
         - Database user: cluebringer
         - Database password: d8KYoyrUqcnDw5ZKSohjyqxTLmAlj9

     * Log file:
         - /etc/syslog.conf
         - 

Dovecot:
     * Configuration files:
         - /usr/local/etc/dovecot/dovecot.conf
         - /usr/local/etc/dovecot/dovecot-ldap.conf (For OpenLDAP backend)
         - /usr/local/etc/dovecot/dovecot-mysql.conf (For MySQL backend)
         - /usr/local/etc/dovecot/dovecot-pgsql.conf (For PostgreSQL backend)
         - /usr/local/etc/dovecot/dovecot-used-quota.conf (For real-time quota usage)
         - /usr/local/etc/dovecot/dovecot-share-folder.conf (For IMAP sharing folder)
     * RC script: /usr/local/etc/rc.d/dovecot
     * Log files:
         - /var/log/dovecot.log
         - /var/log/dovecot-sieve.log
         - /var/log/dovecot-lmtp.log
     * See also:
         - /var/vmail/sieve/dovecot.sieve
         - Logrotate config file: /usr/local/etc/logrotate.d/dovecot

 ClamAV:
     * Configuration files:
         - /usr/local/etc/clamd.conf
         - /usr/local/etc/freshclam.conf
         - /etc/logrotate.d/clamav
     * RC scripts:
             + /usr/local/etc/rc.d/clamd
             + /usr/local/etc/rc.d/freshclamd
     * Log files:
         - /var/log/clamav/clamd.log
         - /var/log/clamav/freshclam.log

 DNS record for DKIM support:

 ; key#1 2048 bits, i=dkim, d=mail.example.net, /var/lib/dkim/mail.example.net.pem
 dkim._domainkey.mail.example.net.    3600 TXT (
   "v=DKIM1; p="
   "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7cTKzf4RJ7n4IN4cgpZl"
   "8ms8FoS036N+JgNGcf6uNtqpxHtgOsH6eAaL16dFFPSJ2vUGVBNLStf6BQ1AFxk+"
   "4WOV7hx0WToT6g9KXPYSWy+FR35wDDV42+1PrcdfEE5ayDPz7UbByVvBN8YXd8Wo"
   "WSs5QUYNTePWO4jlmbKVQolZqeXC6+XH3ogVkSQtWGvHBNxB8l68aDgEk25aAPgW"
   "6yUDgb8T2KWzI/x7FPGsQ2pTIjmQ0SSo/JJ+Q+/t7sR4+I+zYQEOerW1nwcF24Zy"
   "FSfXXvec4+wiuaxW+0Jhir8Au4c4Wcn9KDBOnFmb14LjcLrz+PGv53c1ovCMv7Kh"
   "XQIDAQAB")
 Amavisd-new:
     * Configuration files:
         - /usr/local/etc/amavisd.conf
         - /usr/local/etc/postfix/master.cf
         - /usr/local/etc/postfix/main.cf
     * RC script:
         - /usr/local/etc/rc.d/amavisd
     * MySQL Database:
         - Database name: amavisd
         - Database user: amavisd
         - Database password: fILM301kEUgY7txF8jTzmXlYKTPP7V
         - SQL template: /root/iRedMail-0.9.2/samples/amavisd/amavisd.mysql

 SpamAssassin:
     * Configuration files and rules:
         - /usr/local/etc/mail/spamassassin
         - /usr/local/etc/mail/spamassassin/local.cf

 iRedAPD - Postfix Policy Daemon:
     * Version: 1.6.0
     * Listen address: 127.0.0.1, port: 7777
     * Related files:
         - /opt/iRedAPD-1.6.0/
         - /opt/iredapd/
         - /opt/iredapd/etc/settings.py

 iRedAdmin - official web-based admin panel:
     * Version: 0.4.2
     * Configuration files:
         - /usr/local/www/iRedAdmin-0.4.2/
         - /usr/local/www/iRedAdmin-0.4.2/settings.py*
     * URL:
         - https://iRedMail.example.net/iredadmin/
     * Login account:
         - Username: postmaster@mail.example.net, password: password
     * SQL database account:
         - Database name: iredadmin
         - Username: iredadmin
         - Password: 4Bd7b1NmW9DkPIikLT2xPx2jYH6XmU
     * Settings:
         - /usr/local/www/iRedAdmin-0.4.2/settings.py
     * See also:
         - /iredadmin.conf

 Roundcube webmail: /usr/local/www/roundcube
     * Configuration files:
         - /usr/local/www/roundcube/config
     * URL:
         - http://iRedMail.example.net/mail/
         - https://iRedMail.example.net/mail/ (Over SSL/TLS)
     * Login account:
         - Username: postmaster@mail.example.net, password: password
     * SQL database account:
         - Database name: roundcubemail
         - Username: roundcube
         - Password: fP1GppDNPubAPqkNRNR61KUUHAF1xr
     * See also:
         - /roundcubemail.conf

ウェブメールで管理者で入ってみたところです。上記のメールを見ているところですね。

 管理画面の方を見ます。日本語はないので、英語にしています。
 
 
 パスワードの変更画面もあります。Roundcubeのページでもできますが…。
ランダムなパスワードも準備してくれているのが面白い。
 
 ドメインの追加も簡単。
 
 Global adminだと全体の管理もできる管理者権限ということになりそう。
 

PostfixAdminより、良い感じがしました。
アンチウィルスやスパム除去なども入っているし。

設定ファイル系を見ます。

#cd /usr/local/etc
#ll
total 692
-rwxr-xr-x  1 root     wheel    13546 Nov  1 09:57 amavisd-custom.conf*
-r-xr-xr-x  1 root     wheel    13546 Nov  1 09:57 amavisd-custom.conf.sample*
-rw-r-----  1 root     vscan    25092 Nov  1 11:37 amavisd.conf
-r-xr-xr-x  1 root     wheel    40180 Nov  1 09:57 amavisd.conf-default*
-rwxr-xr-x  1 root     wheel    36709 Nov  1 11:37 amavisd.conf.2015.11.01.11.35.47*
-r-xr-xr-x  1 root     wheel    36709 Nov  1 09:57 amavisd.conf.sample*
-rw-r--r--  1 root     wheel      157 Nov  1 10:11 aspell.ver
drwxr-xr-x  2 root     wheel      512 Oct 31 22:47 bash_completion.d/
-rw-r--r--  1 root     wheel    18828 Nov  1 11:37 clamd.conf
-rw-r--r--  1 root     wheel    18826 Nov  1 11:37 clamd.conf.2015.11.01.11.35.47
-rw-r--r--  1 root     wheel    18826 Nov  1 10:14 clamd.conf.sample
-rwx------  1 policyd  policyd   3469 Nov  1 11:37 cluebringer.conf*
-rw-r--r--  1 root     wheel     3350 Nov  1 11:37 cluebringer.conf.2015.11.01.11.35.47
-rw-r--r--  1 root     wheel     3350 Nov  1 10:12 cluebringer.conf.sample
drwxr-xr-x  3 root     wheel      512 Nov  1 11:37 dovecot/
drwxr-xr-x  4 root     wheel      512 Nov  1 10:03 fonts/
-rw-r--r--  1 root     wheel     8572 Nov  1 11:37 freshclam.conf
-rw-r--r--  1 root     wheel     8572 Nov  1 11:37 freshclam.conf.2015.11.01.11.35.47
-rw-r--r--  1 root     wheel     8572 Nov  1 10:14 freshclam.conf.sample
-rw-r--r--  1 root     wheel      433 Nov  1 11:36 logrotate.conf
-rw-r--r--  1 root     wheel      433 Nov  1 11:36 logrotate.conf.sample
drwxr-xr-x  2 root     wheel      512 Nov  1 11:37 logrotate.d/
drwxr-xr-x  6 root     wheel      512 Nov  1 11:36 logwatch/
drwxr-xr-x  3 root     wheel      512 Nov  1 09:52 mail/
drwxr-xr-x  2 root     wheel      512 Oct 31 23:14 man.d/
drwxr-xr-x  3 root     wheel      512 Nov  1 11:36 nginx/
drwxr-xr-x  3 root     wheel      512 Nov  1 11:36 openldap/
-rw-r--r--  1 root     wheel    35452 Nov  1 09:54 p0f.fp
-rw-r--r--  1 root     wheel      480 Nov  1 10:24 pear.conf
-rw-r--r--  1 root     wheel      480 Nov  1 10:24 pear.conf.sample
drwxr-xr-x  5 root     wheel      512 Oct 31 22:47 periodic/
drwxr-xr-x  2 root     wheel      512 Nov  1 10:23 php/
-rw-r--r--  1 root     wheel    22503 Nov  1 11:36 php-fpm.conf
-rw-r--r--  1 root     wheel    22497 Nov  1 11:36 php-fpm.conf.2015.11.01.11.35.47
-rw-r--r--  1 root     wheel    22497 Nov  1 10:06 php-fpm.conf.default
-rw-r--r--  1 root     wheel       72 Nov  1 10:06 php.conf
-rw-r--r--  1 root     wheel    69277 Nov  1 11:36 php.ini
-rw-r--r--  1 root     wheel    69236 Nov  1 10:06 php.ini-development
-rw-r--r--  1 root     wheel    69266 Nov  1 10:06 php.ini-production
-rw-r--r--  1 root     wheel     2100 Oct 27 10:18 pkg.conf
-rw-r--r--  1 root     wheel     2100 Oct 27 10:18 pkg.conf.sample
drwxr-xr-x  4 root     wheel      512 Nov  1 11:37 postfix/
-rw-r--r--  1 root     wheel     1154 Nov  1 09:54 rarfiles.lst
drwxr-xr-x  2 root     wheel      512 Nov  1 11:37 rc.d/
drwxr-xr-x  2 root     wheel      512 Nov  1 08:59 ssl/
drwxr-xr-x  2 root     wheel      512 Nov  1 11:36 uwsgi/
drwxr-xr-x  2 root     wheel      512 Oct 31 22:47 vim/

VIMは個人で追加しているものですが。
こんな感じになっていました。
logrotateかぁ。Linuxっぽい感じです。

cron系も見ておきます。

#crontab -l
0   3   *   *   *   /usr/local/bin/bash /var/vmail/backup/backup_openldap.sh

# iRedMail: Backup MySQL databases on 03:30 AM
30   3   *   *   *   /usr/local/bin/bash /var/vmail/backup/backup_mysql.sh

# iRedMail: Cleanup Cluebringer database
1   3   *   *   *   /usr/local/bin/cbpadmin --config=/usr/local/etc/cluebringer.conf --cleanup >/dev/null

# iRedMail: Cleanup Amavisd database
1   2   *   *   *   /usr/local/bin/python /usr/local/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null

LDAPのバックアップも日次で加わっている。/var/vmail/backup/ldap/以下に保存されるようになっていました。

サービス関連を見ます。

#cd /usr/local/etc/rc.d 
#ll
total 88
-r-xr-xr-x  1 root  wheel   1086 Nov  1 09:57 amavis-p0fanalyzer*
-r-xr-xr-x  1 root  wheel   1354 Nov  1 09:57 amavisd*
-r-xr-xr-x  1 root  wheel    786 Nov  1 09:57 amavisd-snmp*
-r-xr-xr-x  1 root  wheel   1026 Nov  1 10:14 clamav-clamd*
-r-xr-xr-x  1 root  wheel    722 Nov  1 10:14 clamav-freshclam*
-r-xr-xr-x  1 root  wheel   1581 Nov  1 09:49 dovecot*
-rwxr-xr-x  1 root  wheel   2101 Nov  1 11:37 iredapd*
-r-xr-xr-x  1 root  wheel   2187 Nov  1 09:46 mysql-server*
-r-xr-xr-x  1 root  wheel   3559 Nov  1 10:04 nginx*
-r-xr-xr-x  1 root  wheel    770 Nov  1 10:06 php-fpm*
-r-xr-xr-x  1 root  wheel    521 Nov  1 10:12 policyd2*
-r-xr-xr-x  1 root  wheel   1182 Nov  1 09:59 postfix*
-r-xr-xr-x  1 root  wheel   1126 Nov  1 09:52 sa-spamd*
-r-xr-xr-x  1 root  wheel   3607 Nov  1 09:20 slapd*
-r-xr-xr-x  1 root  wheel   3369 Nov  1 10:04 uwsgi*
-rwxr-xr-x  1 root  wheel  26347 Nov  1 08:20 vmware-tools.sh*

/etc/rc.conf の部分抜粋。

# iRedMail-nginx_enable
nginx_enable='YES'
# iRedMail-php_fpm_enable
php_fpm_enable='YES'
# iRedMail-uwsgi_enable
uwsgi_enable='YES'
# iRedMail-uwsgi_profiles
uwsgi_profiles='iredadmin'
# iRedMail-uwsgi_iredadmin_flags
uwsgi_iredadmin_flags='--ini /usr/local/etc/uwsgi/iredadmin.ini'
# iRedMail-slapd_enable
slapd_enable='YES'
# iRedMail-slapd_flags
slapd_flags='-h "ldapi://%2fvar%2frun%2fopenldap%2fldapi/ ldap://0.0.0.0/ ldaps://0.0.0.0/"'
# iRedMail-slapd_sockets
slapd_sockets='/var/run/openldap/ldapi'
# iRedMail-mysql_enable
mysql_enable='YES'
# iRedMail-mysql_optfile
mysql_optfile='/var/local/mysql/my.cnf'
# iRedMail-postfix_enable
postfix_enable='YES'
# iRedMail-sendmail_enable
sendmail_enable='NO'
# iRedMail-sendmail_submit_enable
sendmail_submit_enable='NO'
# iRedMail-sendmail_outbound_enable
sendmail_outbound_enable='NO'
# iRedMail-sendmail_msp_queue_enable
sendmail_msp_queue_enable='NO'
# iRedMail-daily_clean_hoststat_enable
daily_clean_hoststat_enable='NO'
# iRedMail-daily_status_mail_rejects_enable
daily_status_mail_rejects_enable='NO'
# iRedMail-daily_status_include_submit_mailq
daily_status_include_submit_mailq='NO'
# iRedMail-daily_submit_queuerun
daily_submit_queuerun='NO'
# iRedMail-policyd2_enable
policyd2_enable='YES'
# iRedMail-dovecot_enable
dovecot_enable='YES'
# iRedMail-clamav_clamd_enable
clamav_clamd_enable='YES'
# iRedMail-clamav_freshclam_enable
clamav_freshclam_enable='YES'
# iRedMail-amavisd_enable
amavisd_enable='YES'
# iRedMail-amavisd_pidfile
amavisd_pidfile='/var/amavis/amavisd.pid'
# iRedMail-amavis_milter_enable
amavis_milter_enable='NO'
# iRedMail-amavis_p0fanalyzer_enable
amavis_p0fanalyzer_enable='NO'
# iRedMail-iredapd_enable
iredapd_enable='YES'

どこが開いている?

#sockstat -4 -l
USER     COMMAND    PID   FD PROTO  LOCAL ADDRESS         FOREIGN ADDRESS
vmail    lmtp       1031  9  tcp4   127.0.0.1:24          *:*
vmail    lmtp       1030  9  tcp4   127.0.0.1:24          *:*
vmail    lmtp       1029  9  tcp4   127.0.0.1:24          *:*
vmail    lmtp       1028  9  tcp4   127.0.0.1:24          *:*
vmail    lmtp       1025  9  tcp4   127.0.0.1:24          *:*
root     sshd       913   4  tcp4   *:22                  *:*
iredapd  python2.7  891   4  tcp4   127.0.0.1:7777        *:*
www      nginx      882   7  tcp4   *:80                  *:*
www      nginx      882   8  tcp4   *:443                 *:*
root     nginx      878   7  tcp4   *:80                  *:*
root     nginx      878   8  tcp4   *:443                 *:*
policyd  perl       871   6  tcp4   127.0.0.1:10031       *:*
policyd  perl       870   6  tcp4   127.0.0.1:10031       *:*
policyd  perl       869   6  tcp4   127.0.0.1:10031       *:*
policyd  perl       868   6  tcp4   127.0.0.1:10031       *:*
policyd  perl       865   6  tcp4   127.0.0.1:10031       *:*
root     master     859   13 tcp4   *:25                  *:*
root     master     859   88 tcp4   *:587                 *:*
root     master     859   97 tcp4   127.0.0.1:10025       *:*
root     dovecot    767   15 tcp4   127.0.0.1:4190        *:*
root     dovecot    767   25 tcp4   *:110                 *:*
root     dovecot    767   27 tcp4   *:995                 *:*
root     dovecot    767   32 tcp4   127.0.0.1:24          *:*
root     dovecot    767   42 tcp4   *:143                 *:*
root     dovecot    767   44 tcp4   *:993                 *:*
vscan    perl       747   5  tcp4   127.0.0.1:10024       *:*
vscan    perl       747   7  tcp4   127.0.0.1:9998        *:*
vscan    perl       746   5  tcp4   127.0.0.1:10024       *:*
vscan    perl       746   7  tcp4   127.0.0.1:9998        *:*
vscan    perl       745   5  tcp4   127.0.0.1:10024       *:*
vscan    perl       745   7  tcp4   127.0.0.1:9998        *:*
vscan    perl       744   5  tcp4   127.0.0.1:10024       *:*
vscan    perl       744   7  tcp4   127.0.0.1:9998        *:*
vscan    perl       741   5  tcp4   127.0.0.1:10024       *:*
vscan    perl       741   7  tcp4   127.0.0.1:9998        *:*
mysql    mysqld     736   13 tcp4 6 *:3306                *:*
ldap     slapd      529   6  tcp4   *:389                 *:*
ldap     slapd      529   7  tcp4   *:636                 *:*
root     syslogd    445   7  udp4   *:514                 *:*

logwatchは、ログ監視かな。/usr/local/etc/openldap以下のslapd.confなども興味深く参照。

#pkg info|grep ldap
openldap-sasl-client-2.4.42_2  Open source LDAP client implementation with SASL2 support
openldap-sasl-server-2.4.42_2  Open source LDAP server implementation
p5-perl-ldap-0.6500            Client interface to LDAP (includes Net::LDAP)
php55-ldap-5.5.30              The ldap shared extension for php
py27-ldap-2.4.21               LDAP module for python, for OpenLDAP2

なるほど。slapd.confのままで書けるのは良いなぁ。FreeBSDでも実用として入れてみるかな。(OpenLDAPの話)

メールは流石にPostfix。世の中としてはこっちが一般的だもんな。
master.cfとかmain.cfも参考になる!
ちゃんとsmtp_tls_protocols = !SSLv2 !SSLv3とかなっているし。
やっておくべき、みたいな部分が初期設定になっているのは良い感じです。

policyd って何をやっているのだろう?Greylisting系?ログローテートしているのは、このpolicyd。結構ログが出るのかな。

Windowsパソコンからメールを送信してみた。良い感じ。25番ポートがそのままに外と通信できないため、抜けていってはくれないですが…。
受信は、pop ssl/tlsじゃないとダメというセキュアな状態。良い感じ。だけど、受信はこのままだと苦労しそう。
http://www.iredmail.org/docs/allow.insecure.pop3.imap.smtp.connections.html
これを対処。問題無く利用できました。結構面倒な部分も初期で準備されているのが便利です。

CentOSなどで準備するとより簡単なのかも知れませんが、今回はそっちはお試しする気はありません。
SSLもオレオレじゃない証明書を使うと安心に利用できそうです。

【改訂履歴】作成:2015/10/25 更新:2015/11/1
【参考リンク】

Install iRedMail on FreeBSD

Copyright © 1996,1997-2006,2007- by F.Kimura,