FC4付属の sendmail で APOP 認証と pop3s への対応(qpopper)
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
#contents
----
* FC4 における qpopper を用いた APOP 認証と pop3s の対応 ...
** 準備 [#s2a82051]
まずはじめに qpopper のコンパイルとセットアップが必要に...
[[FC4付属の sendmail で POP before SMTP(qpopper+DRAC)へ...
- [[qpopper のインストール:http://pocketstudio.jp/linux/?...
** APOP 認証への対応 [#h0079520]
実は qpopper のインストール時に APOP 認証に対応できるよ...
--enable-apop=/etc/mail/apop.auth
ですので、あとは【 /etc/mail/apop.auth 】ファイルにユー...
/usr/local/sbin/popauth -user ユーザ名
ユーザ名は linux アカウント、つまり普通のメール受信ユー...
以下は実行例です。
# /usr/local/sbin/popauth -user akane
Adding only APOP password for akane.
New password:
Retype new password:
これは akane というユーザに対して APOP 認証用のパスワー...
あとはメールソフト側で認証方法を APOP に切り替えるだけ...
/var/log/maillog には次のような認証時の記録が保存されま...
Jul 19 21:02:53 sion popper[14833]: apop "akane"
sion というホスト名で popper プロセス pid 14833 が apop...
認証に失敗すると通常の認証時と同様にエラーが記録されま...
popper[15018]: akane at 192.168.11.102 (192.168.11.102):...
ちなみに APOP 認証を行わせない(リストから削除する)時は
/usr/local/sbin/popauth -delete ユーザ名
こちらのコマンドを使います。
** pop3s への対応 [#p8e6c5d2]
以下手順を追って POP3S に対応します。POP3S に対応すると...
まず xinetd 用のファイルを作成します。
# vi /etc/xinetd.d/pop3s
ファイルを開いたら、以下のようにサービスの記述を行いま...
service pop3s
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/popper
server_args = -s -f /etc/mail/qpopper.config
}
次に vi で設定ファイルを作ります。
# vi /etc/mail/qpopper.config
中身は次のようにしてください。
set tls-support = alternate-port
set tls-server-cert-file =/etc/pki/qpopper.pem
次に、/etc/pki/qpopper.pem と指定した SSL 用の証明書を...
まずはディレクトリ作成です。
# mkdir -p -m665 /etc/mail/certs
# chown root:mail /etc/mail/certs
# chmod 660 /etc/mail/certs
# cd /etc/mail/certs
次は公開鍵と秘密鍵の組み合わせを作成します。
# /usr/bin/openssl req -new -nodes -out req.pem -keyout ...
Generating a 1024 bit RSA private key
.........................++++++
.................++++++
writing new private key to '/etc/mail/certs/cert.pem'
-----
You are about to be asked to enter information that will...
into your certificate request.
What you are about to enter is what is called a Distingu...
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:
まずここでは国コード、日本なので【 JP 】と入力してエン...
Country Name (2 letter code) [GB]:JP
State or Province Name (full name) [Berkshire]:
州名・都道府県名を記述します。私は富山県なので【 Toyama...
State or Province Name (full name) [Berkshire]:Toyama-ken
Locality Name (eg, city) [Newbury]:
次は市区町村名です。私は滑川市という所に住んでいるので...
Locality Name (eg, city) [Newbury]:Namerikawa-shi
Organization Name (eg, company) [My Company Ltd]:
その次は組織名です。【 Pocketstudio.jp 】と入力しました。
Organization Name (eg, company) [My Company Ltd]:Pockets...
Organizational Unit Name (eg, section) []:
その次は部署名です。特にないので、そのままエンターを押...
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
ここではサーバの正しい名前(FQDN)を入力しなくてはいけま...
あとはエンターで飛ばします。
Common Name (eg, your name or your server's hostname) []...
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
次にコマンドを実行してパーミッションを変えます。
# chmod 600 /etc/mail/certs/cert.pem
# chown root:0 /etc/mail/certs/cert.pem
これで秘密鍵の作成を完了しました。
次からは自己認証の設定です。
# cd /etc/mail/certs
# /usr/bin/openssl genrsa -out ca.key 1024
Generating RSA private key, 1024 bit long modulus
................................................++++++
....++++++
e is 65537 (0x10001)
(本当は -des3 オプションをつけてパスフレーズをつけるべき...
引き続き、次のコマンドを入力します。
# /usr/bin/openssl req -new -x509 -days 365 -key ca.key ...
You are about to be asked to enter information that will...
into your certificate request.
What you are about to enter is what is called a Distingu...
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:
先のように所在地情報を尋ねてきますので、一字一句間違え...
Country Name (2 letter code) [GB]:JP
State or Province Name (full name) [Berkshire]:Toyama-ken
Locality Name (eg, city) [Newbury]:Namerikawa-shi
Organization Name (eg, company) [My Company Ltd]:Pockets...
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []...
Email Address []:
# /usr/bin/openssl x509 -req -CA ca.crt -CAkey ca.key -d...
Signature ok
subject=/C=JP/ST=Toyama-ken/L=Namerikawa-shi/O=Pocketstu...
Getting CA Private Key
これで署名が終わりました。
最期に署名ファイルと鍵をまとめます(どうもこれをしない...
# cat signed-req.pem >> cert.pem
あとは /etc/mail/qpopper.config ファイルを編集します。
set tls-options = 0x00000800
set tls-support = alternate-port
set tls-server-cert-file =/etc/mail/certs/cert.pem
最期に xinetd を再起動して pop3s サービスを有効にします。
# /sbin/service xinetd restart
xinetd を停止中: ...
xinetd を起動中: ...
メールソフト側でメールを POP3S に対応して受信できるよう...
正しく認証できると、以下のように SSL に対応した旨の記録...
popper[xxxxx]: (v4.0.8) TLSv1/SSLv3 handshake with clien...
new session-id; cipher: RC4-MD5 (RC4-MD5 SSLv3 Kx=RSA Au...
もちろん、この状態でも APOP 認証は有効ですから POP befo...
終了行:
#contents
----
* FC4 における qpopper を用いた APOP 認証と pop3s の対応 ...
** 準備 [#s2a82051]
まずはじめに qpopper のコンパイルとセットアップが必要に...
[[FC4付属の sendmail で POP before SMTP(qpopper+DRAC)へ...
- [[qpopper のインストール:http://pocketstudio.jp/linux/?...
** APOP 認証への対応 [#h0079520]
実は qpopper のインストール時に APOP 認証に対応できるよ...
--enable-apop=/etc/mail/apop.auth
ですので、あとは【 /etc/mail/apop.auth 】ファイルにユー...
/usr/local/sbin/popauth -user ユーザ名
ユーザ名は linux アカウント、つまり普通のメール受信ユー...
以下は実行例です。
# /usr/local/sbin/popauth -user akane
Adding only APOP password for akane.
New password:
Retype new password:
これは akane というユーザに対して APOP 認証用のパスワー...
あとはメールソフト側で認証方法を APOP に切り替えるだけ...
/var/log/maillog には次のような認証時の記録が保存されま...
Jul 19 21:02:53 sion popper[14833]: apop "akane"
sion というホスト名で popper プロセス pid 14833 が apop...
認証に失敗すると通常の認証時と同様にエラーが記録されま...
popper[15018]: akane at 192.168.11.102 (192.168.11.102):...
ちなみに APOP 認証を行わせない(リストから削除する)時は
/usr/local/sbin/popauth -delete ユーザ名
こちらのコマンドを使います。
** pop3s への対応 [#p8e6c5d2]
以下手順を追って POP3S に対応します。POP3S に対応すると...
まず xinetd 用のファイルを作成します。
# vi /etc/xinetd.d/pop3s
ファイルを開いたら、以下のようにサービスの記述を行いま...
service pop3s
{
disable = no
socket_type = stream
wait = no
user = root
server = /usr/local/sbin/popper
server_args = -s -f /etc/mail/qpopper.config
}
次に vi で設定ファイルを作ります。
# vi /etc/mail/qpopper.config
中身は次のようにしてください。
set tls-support = alternate-port
set tls-server-cert-file =/etc/pki/qpopper.pem
次に、/etc/pki/qpopper.pem と指定した SSL 用の証明書を...
まずはディレクトリ作成です。
# mkdir -p -m665 /etc/mail/certs
# chown root:mail /etc/mail/certs
# chmod 660 /etc/mail/certs
# cd /etc/mail/certs
次は公開鍵と秘密鍵の組み合わせを作成します。
# /usr/bin/openssl req -new -nodes -out req.pem -keyout ...
Generating a 1024 bit RSA private key
.........................++++++
.................++++++
writing new private key to '/etc/mail/certs/cert.pem'
-----
You are about to be asked to enter information that will...
into your certificate request.
What you are about to enter is what is called a Distingu...
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:
まずここでは国コード、日本なので【 JP 】と入力してエン...
Country Name (2 letter code) [GB]:JP
State or Province Name (full name) [Berkshire]:
州名・都道府県名を記述します。私は富山県なので【 Toyama...
State or Province Name (full name) [Berkshire]:Toyama-ken
Locality Name (eg, city) [Newbury]:
次は市区町村名です。私は滑川市という所に住んでいるので...
Locality Name (eg, city) [Newbury]:Namerikawa-shi
Organization Name (eg, company) [My Company Ltd]:
その次は組織名です。【 Pocketstudio.jp 】と入力しました。
Organization Name (eg, company) [My Company Ltd]:Pockets...
Organizational Unit Name (eg, section) []:
その次は部署名です。特にないので、そのままエンターを押...
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []:
ここではサーバの正しい名前(FQDN)を入力しなくてはいけま...
あとはエンターで飛ばします。
Common Name (eg, your name or your server's hostname) []...
Email Address []:
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:
An optional company name []:
次にコマンドを実行してパーミッションを変えます。
# chmod 600 /etc/mail/certs/cert.pem
# chown root:0 /etc/mail/certs/cert.pem
これで秘密鍵の作成を完了しました。
次からは自己認証の設定です。
# cd /etc/mail/certs
# /usr/bin/openssl genrsa -out ca.key 1024
Generating RSA private key, 1024 bit long modulus
................................................++++++
....++++++
e is 65537 (0x10001)
(本当は -des3 オプションをつけてパスフレーズをつけるべき...
引き続き、次のコマンドを入力します。
# /usr/bin/openssl req -new -x509 -days 365 -key ca.key ...
You are about to be asked to enter information that will...
into your certificate request.
What you are about to enter is what is called a Distingu...
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [GB]:
先のように所在地情報を尋ねてきますので、一字一句間違え...
Country Name (2 letter code) [GB]:JP
State or Province Name (full name) [Berkshire]:Toyama-ken
Locality Name (eg, city) [Newbury]:Namerikawa-shi
Organization Name (eg, company) [My Company Ltd]:Pockets...
Organizational Unit Name (eg, section) []:
Common Name (eg, your name or your server's hostname) []...
Email Address []:
# /usr/bin/openssl x509 -req -CA ca.crt -CAkey ca.key -d...
Signature ok
subject=/C=JP/ST=Toyama-ken/L=Namerikawa-shi/O=Pocketstu...
Getting CA Private Key
これで署名が終わりました。
最期に署名ファイルと鍵をまとめます(どうもこれをしない...
# cat signed-req.pem >> cert.pem
あとは /etc/mail/qpopper.config ファイルを編集します。
set tls-options = 0x00000800
set tls-support = alternate-port
set tls-server-cert-file =/etc/mail/certs/cert.pem
最期に xinetd を再起動して pop3s サービスを有効にします。
# /sbin/service xinetd restart
xinetd を停止中: ...
xinetd を起動中: ...
メールソフト側でメールを POP3S に対応して受信できるよう...
正しく認証できると、以下のように SSL に対応した旨の記録...
popper[xxxxx]: (v4.0.8) TLSv1/SSLv3 handshake with clien...
new session-id; cipher: RC4-MD5 (RC4-MD5 SSLv3 Kx=RSA Au...
もちろん、この状態でも APOP 認証は有効ですから POP befo...
ページ名: