centos6上搭建postfix+dovecot+saslauthd郵件服務器

service sendmail stop

chkconfig sendmail off

groupadd -g 1200 postdrop

groupadd -g 1000 postfix

useradd -M -u 1000 -g postfix -G postdrop -s /sbin/nologin postfix 

usermod -g 51 -G 48 smmsp

yum install db4-devel cyrus-sasl-devel pam pam-devel mysql-devel dovecot cyrus-sasl cyrus-sasl-lib cyrus-sasl-plain




postfix配置文件main.cf修改樣例

mydomain = skymobi.com

myhostname = mail.skymobi.com

myorigin = $mydomain

mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain

inet_interfaces = all

mynetworks = 0.0.0.0/0


文件末尾加上

setgid_group = postdrop

smtpd_banner = welcome to our $myhostname ESMTP,warning: version not available!

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_invalid_hostname,reject_non_fqdn_hostname,reject_unknown_sender_domain,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unknown_recipient_domain,reject_unauth_pipelining,reject_unauth_destination

smtpd_sasl_auth_enable = yes

smtpd_sasl_local_domain = $myhostname

smtpd_sasl_path = smtpd

smtpd_sasl_security_options = noanonymous

unknown_local_recipient_reject_code = 550



saslauthd配置文件修改

mkdir /usr/lib/sasl2/

vim /usr/lib/sasl2/smtpd.conf

level: 3

pwcheck_method: saslauthd

mech_list: LOGIN PLAIN




dovecot配置文件 

vim /etc/dovecot/dovecot.conf

protocols = pop3 imap lmtp 

dict {

  #quota = mysql:/etc/dovecot/dovecot-dict-sql.conf.ext

  #expire = sqlite:/etc/dovecot/dovecot-dict-sql.conf.ext

}

!include conf.d/*.conf



vim /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = no

auth_mechanisms = plain login

!include auth-system.conf.ext



vim /etc/dovecot/conf.d/10-master.conf 修改 

unix_listener /var/spool/postfix/private/auth {

    group = postfix

    mode = 0660

    user = postfix

}









發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章