postfix配置

By | 2013年5月24日

mai.cf

#新增的内容开始

myhostname = mail.domain.cn
myorigin = domain.cn
inet_interfaces = all
inet_protocols = ipv4
mydestination = domain.cn, localhost
mynetworks = 127.0.0.0/8, hash:/etc/postfix/access
alias_maps = hash:/etc/aliases

#网易诚信联盟通道
transport_maps = hash:/etc/postfix/transport
#DKIM
smtpd_milters = inet:localhost:10000
non_smtpd_milters = inet:localhost:10000
milter_protocol = 2
milter_default_action = accept
#smtpd_recipient_limit = 100000

#SMTP认证
smtpd_recipient_restrictions = 
  permit_sasl_authenticated, 
  reject_invalid_hostname,  
  reject_unknown_sender_domain, 
  reject_unknown_recipient_domain, 
  reject_unauth_pipelining, 
  reject_unauth_destination, 
  permit
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable =yes
smtpd_sasl_local_domain = $myhostname
#新增内容结束

/etc/sasl2/smtpd.conf

#pwcheck_method:auxprop
pwcheck_method:saslauthd
mech_list: plain login

启动saslauthd:service saslauthd start

默认使用pam。

/etc/pam.d/smtp.postfix

#%PAM-1.0
#auth       include	password-auth
#account    include	password-auth
auth requisite pam_unix.so
account requisite pam_unix.so