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

service sendmail stopmysql

chkconfig sendmail offsql

groupadd -g 1200 postdropvim

groupadd -g 1000 postfixdom

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

usermod -g 51 -G 48 smmsppost

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




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

mydomain = skymobi.comcode

myhostname = mail.skymobi.comsqlite

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

}

相關文章
相關標籤/搜索