必要 Package
(1) sendmail / sendmail-cf
(2) cyrus-sasl / cyrus-sasl-lib
1. Sendmail configuration
1.1 編輯 sendmail.mc , 開啟 smtp auth 功能
TRUST_AUTH_MECH(`LOGIN PLAIN')dnl
define(`confAUTH_MECHANISMS', `LOGIN PLAIN')dnl
1.2 sendmail.mc -> sendmail.cf
# m4 sendmail.mc > sendmail.cf
1.3 重啟 sendmail
# chkconfig --level 345 sendmail on
# service sendmail start
2. Cyrus-sasl configuration
2.1 針對 sendmail 的 SASL 認證方法, 預設在 /usr/lib/sasl2/Sendmail.conf
編輯 /usr/lib/sasl2/Sendmail.conf , 設定認證方式透過 saslauthd
pwcheck_method:saslauthd
mech_list:LOGIN PLAIN
2.2 設定 saslauthd 利用 ldap 認證
編輯 /etc/sysconfig/saslauthd
MECH=ldap
2.3 設定 /etc/saslauthd.conf
ldap_servers: ldap://whateverserver.net:389/
ldap_search_base: ou=people,dc=xxx,dc=xxx
ldap_timeout: 10
ldap_filter: cn=%u
ldap_bind_dn: cn=root,dc=xxx,dc=xxx
ldap_password: secret
ldap_deref: never
ldap_restart: yes
ldap_scope: sub
ldap_version: 3
ldap_auth_method: bind
2.4 啟動 cyrus-sasl
# chkconfig --level 345 saslauthd on
# service saslauthd start
以上即 完成 Sendmail SMTP AUTH 設定