mkdir -p /var/spool/postfix/var/run/saslauthd
gedit /etc/postfix/sasl/smtpd.conf
创建smtpd.conf,并且内容如下:
pwcheck_method:saslauthd
mech_list:plain login
allow_plaintext: true
auxprop_plugin: mysql
sql_hostnames: 127.0.0.1
sql_user: extmail
sql_password: extmail
sql_database: extmail
log_level:7
sql_select: SELECT password FROM mailbox WHERE username='%u@%r' and domain='%r'
4.更改main.cf 文件
gedit /etc/postfix/main.cf
###########SASL######################
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_recipient_restrictions = permit_mynetworks,reject_sender_login_mismatch, permit_sasl_authenticated,reject_unknown_sender_domain, reject_non_fqdn_hostname,reject_non_fqdn_sender, reject_non_fqdn_recipient,reject_unknown_recipient_domain, reject_unauth_destination,reject_unauth_pipelining, reject_invalid_hostname, check_recipient_maps
加入以上的内容
添加用户
adduser postfix sasl
