Postfix

説明

Postfix自体にSMTP認証機能がないため、SASLという別のミドルウェアで認証を管理設定する手順です。

設定内容

[root@]# cd /etc/sasl2
[root@]# cp -p smtpd.conf smtpd.conf.`date +%Y%m%d`
[root@]# vi smtpd.conf
pwcheck_method: saslauthd
mech_list: plain login

pwcheck_method: saslauthd ← SASLチェック用デーモンを利用する場合
pwcheck_method: auxprop ← SASL用パスワードファイルを利用する場合
pwcheck_method: pwcheck ←Unixパスワードデータベースを利用する場合
※SASLを利用する場合はsaslauthdのままで良い。

UNIXパスワードを使用して認証する。

[root@]# vi smtpd.conf
pwcheck_method: pwcheck
mech_list: plain login
[root@]# service saslauthd start
[root@]# chkconfig saslauthd on
[root@]# chkconfig saslauthd --list
saslauthd      	0:off	1:off	2:on	3:on	4:on	5:on	6:off
[root@]]# ps aux | grep saslauthd
root     13062  0.0  0.0  66824   988 ?        Ss   13:55   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam
root     13063  0.0  0.0  66824   692 ?        S    13:55   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam
root     13064  0.0  0.0  66824   692 ?        S    13:55   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam
root     13065  0.0  0.0  66824   692 ?        S    13:55   0:00 /usr/sbin/saslauthd -m /var/run/saslauthd -a pam
root     13067  0.0  0.0  66824   692 ?        S    13:55   0:00 /usr/sbin/saslauthd
[root@]# cd /etc/postfix
[root@]# cp -p master.cf master.cf.`date +%Y%m%d`
[root@]# vi master.cf
submission inet n       -       n       -       -       smtpd
#  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_client_restrictions=permit_sasl_authenticated,reject
[root@]# vi main.cf
### SMTP auth 
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes 
smtpd_sasl_local_domain = $mydomain
smtp_sasl_mechanism_filter = plain
smtpd_recipient_restrictions =
       permit_mynetworks,
        permit_sasl_authenticated,
        permit_auth_destination,
        reject
[root@]# /etc/init.d/postfix restart
[root@]# netstat -an -A inet
tcp        0      0 0.0.0.0:587                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN

参考URL:http://www.omnioo.com/omnioolab/2010/09/smtpsasl2.php


トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-06-30 (木) 01:40:11