メールサーバーが動くと次にやりたいのがWEBからのメールですね
と言うことでilohamailをインストールして見ました
但し、Apache2,PHP5,MySQL5,sendmail,qpopperがインストールされている事を前提にします
それではportsでインストールして見ます
すると何やら出て来ますのでその通り実行して見ましょう
# cd /usr/ports/mail/ilohamail
# make install clean
php.iniはデフォルトのままであればそのままで大丈夫です。
# mysql -u root -p Enter password:MySQLのパスワード入力 Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 12 to server version: 5.0.24a Type 'help;' or '\h' for help. Type '\c' to clear the buffer. mysql> use mysql; mysql> grant select,insert,update,delete,index, -> alter,create,drop,references, lock tables, -> create temporary tables on webmail.* to webmail@localhost -> identified by 'パスワード'; mysql> flush privileges; mysql> exit # mysqladmin create webmail # mysql webmail < /usr/local/share/ilohamail/MySQL/sql
と、これで事前作業は終了です
それでは設定して行きます
/usr/local/www/ilohamail/conf/conf.inc を編集する
$backend = "DB";
$AUTH_MODE["imap"] = "plain";
$AUTH_MODE["pop3"] = "apop";
$AUTH_MODE["smtp"] = "auth";
このブロックは個人の環境に合わせて下さい
$SMTP_SERVER = "localhost";
/usr/local/www/ilohamail/conf/db_conf.php を編集する
$DB_HOST="localhost";
$DB_USER="webmail";
$DB_PASSWORD="項目2で設定したパスワード";
/usr/local/www/ilohamail/conf/login.inc を編集する
$default_host = "localhost";
$default_port = 110;
$default_lang = "jp/";
$hide_host = 1;
$hide_protocol = 1;
$hide_rootdir = 1;
$hide_lang = 1;
/usr/local/www/ilohamail/conf/defaults.generic.inc を編集する
$init_from_address = "%u@hogehoge.dyndns.org";;
そしてApacheのconfを編集します
せっかくなのでSSLにするためにssl.confに追記します
/usr/local/etc/apache2/ssl.conf
Alias /webmail/ "/usr/local/www/ilohamail/source/" <Directory "/usr/local/www/ilohamail/source"> AllowOverride All Options All Order allow,deny Allow from all </Directory>
設定が全て終了したらApacheを再起動します
# /usr/local/etc/rc.d/apache2.sh restart
あとはアクセスして見ましょう
https://hogehoge.dyndns.org/webmail/
PHPが動いていないと平文で見えたり、設定が間違っているとログインが帰って来なかったりします
ログインできたら個人設定をしておきましょう
私はなぜか署名が設定しても添付されません・・・なんでだろう