[[Linuxめも]] [[qmailでバーチャルドメイン]]の設定をしてからTLS対応したいと思い調べたけれど確実な情報に辿りつけなかったので、SSL対応で妥協します。 [[ucspi-tcp-ssl-20050405.patch.gz:http://www.nrg4u.com/qmail/ucspi-tcp-ssl-20050405.patch.gz]]をダウンロードし、パッチをあてます。 # cd /usr/local/src/qmail # wget http://www.nrg4u.com/qmail/ucspi-tcp-ssl-20050405.patch.gz # gunzip ucspi-tcp-ssl-20050405.patch.gz # rm -fr ucspi-tcp-0.88 # tar xvzf ucspi-tcp-0.88.tar.gz # cd ucspi-tcp-0.88 # patch < ../ucspi-tcp-ssl-20050405.patch # make SSL化したtcpserverを上書きコピーします。 # cp tcpserver /usr/local/bin サーバ証明書を作成します。 # openssl req -new -nodes -x509 -keyout /var/qmail/qmail.pem -out /var/qmail/qmail.pem -days 3650 Country Name (2 letter code) [XX]:JP State or Province Name (full name) []:Tokyo Locality Name (eg, city) [Default City]:Shibuya Organization Name (eg, company) [Default Company Ltd]:example.com Organizational Unit Name (eg, section) []: Common Name (eg, your name or your server's hostname) []:mail.example.com # メールサーバのFQDN Email Address []: # chmod 600 /var/qmail/qmail.pem 受信のルールを作成 # vi /home/vpopmail/etc/tcp.pop3 :allow,ALLOWPLAIN="",DOMAINOWNER="" # tcprules /home/vpopmail/etc/tcp.pop3.cdb /home/vpopmail/etc/tcp.pop3.tmp < /home/vpopmail/etc/tcp.pop3 起動スクリプトを修正します。~ start)部分のみ抜粋 # vi /etc/rc.d/init.d/qmaild start) echo -n "Starting qmaild: " /usr/local/bin/tcpserver -H -R -x /home/vpopmail/etc/tcp.smtp.cdb \ -c 100 -u qmaild -g nofiles 0 smtp \ /var/qmail/bin/qmail-smtpd 2>&1 \ | /var/qmail/bin/splogger smtpd & /usr/local/bin/tcpserver -H -R \ -s -n /var/qmail/qmail.pem \ -x /home/vpopmail/etc/tcp.smtp.cdb \ -c 100 -u qmaild -g nofiles 0 465 \ /var/qmail/bin/qmail-smtpd 2>&1 \ | /var/qmail/bin/splogger smtpd & /usr/local/bin/tcpserver -H -R -l0 0 110 \ /var/qmail/bin/qmail-popup example.com \ /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1 \ | /var/qmail/bin/splogger pop3d & /usr/local/bin/tcpserver -H -R \ -s -n /var/qmail/qmail.pem \ -x /home/vpopmail/etc/tcp.pop3.cdb -l0 0 995 \ /var/qmail/bin/qmail-popup yassu.info \ /var/qmail/bin/qmail-popup example.com \ /home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2>&1 \ | /var/qmail/bin/splogger pop3d & /var/qmail/rc & echo "ok" touch /var/lock/subsys/qmaild # /etc/rc.d/init.d/qmaild start