Personal tools
You are here: Home コラム 技術コラム popサーバのssl対応
Document Actions

popサーバのssl対応

popにアクセスする際に、平文でパスワードが流れるのが嫌だったのでpopサーバをssl対応にしました。

参考にしたページは以下のページです
http://www.dream-seed.com/linux/qpopper-ssl.html

証明書を作成し、自分で認証して、qpopperとinetdの設定をする、という流れで設定しました。

1. 証明書作成
# mkdir -p -m665 /etc/mail/certs
# chown root:mail /etc/mail/certs

# chmod 660 /etc/mail/certs
# openssl req -new -nodes -out req.pem -keyout /etc/mail/certs/cert.pem
Contry Name : JP
State or Province Name : Tokyo
Locality Name : Meguro-ku
Organization Name : ariel-networks
Organizational Unit Name: ariel-networks
Common Name : pop.ariel-networks.com
Email Address : popmaster@ariel-networks.com
A challenge password : なし
An optional company name: なし
# chmod 600 /etc/mail/certs/cert.pem
# chown root:0 /etc/mail/certs/cert.pem


2. 証明書を自分で認証
# openssl genrsa -des3 -out ca.key 1024
passphrase : xxxxxxx(CAの秘密鍵のパスフレーズ)
# openssl req -new -x509 -days 10950 -key ca.key -out ca.crt
# openssl x509 -req -CA ca.crt -CAkey ca.key -days 10950 -in req.pem -out signed-req.pem -CAcreateserial
# cat signed-req.pem >> /etc/mail/certs/cert.pem

3. qpoperの設定
以下の内容の/etc/qpopper-ssl.confを作成
set tls-support = alternate-port
set tls-server-cert-file = /etc/mail/certs/cert.pem

4. inetdの設定
/etc/inetd.confに以下の1行を追加
pop3s stream tcp nowait root /usr/sbin/tcpd in.qpopper -s -f /etc/qpopper-ssl.conf
inetdのリロード
/etc/init.d/inetd reload


--------
fetchmailでpop3sへのアクセスは
.fetchmailrcにsslを追加するだけでいいようです

例)
defaults
protocol pop3
no rewrite
no mimedecode
ssl
keep
mda "/usr/bin/procmail -d hamagishi"

poll pop.ariel-networks.com
user hamagishi
pass xxxxxxx(個人のパスワード)


Copyright(C) 2001 - 2006 Ariel Networks, Inc. All rights reserved.