yum install postfix dovecot
chkconfig postfix on
chkconfig dovecot on
vi /etc/postfix/main.cf
# change or add on these line: myhostname = mail.zhetenger.com mydomain = zhetenger.com myorigin = $mydomain inet_interfaces = all mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mynetworks = 127.0.0.0/8 home_mailbox = Maildir/ smtpd_sasl_type = dovecot smtpd_sasl_path = private/auth smtpd_sasl_auth_enable = yes smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, permit broken_sasl_auth_clients = yes
重启postfix/etc/init.d/postfix restart
vi /etc/dovecot/dovecot.conf
# uncomment on this line: protocols = imap pop3 listen = *
vi /etc/dovecot/conf.d/10-auth.conf
# change on these line: disable_plaintext_auth = no auth_mechanisms = plain login
vi /etc/dovecot/conf.d/10-mail.conf
mail_location = maildir:~/Maildir
vi /etc/dovecot/conf.d/10-master.conf
# commented on these line: #unix_listener auth-userdb { #mode = 0600 #user = #group = #} # change or setup on these line: # Postfix smtp-auth unix_listener /var/spool/postfix/private/auth { mode = 0666 user = postfix group = postfix }
vi /etc/dovecot/conf.d/20-pop3.conf
# uncomment on these line: pop3_uidl_format = %08Xu%08Xv pop3_client_workarounds = outlook-no-nuls oe-ns-eoh
/etc/init.d/dovecot restart
大功告成!
(CentOS)Centos6.3下搭建postfix/dovecot服务
1.安装和配置dovecot软件 yum install -y dovecot
[root @localhost conf.d]# nslookup
> set type=mx
> abc.com
Server: 192.168.2.115
Address: 192.168.2.115#53
abc.com mail exchanger = 5 mail.abc.com.
> exit
[root @localhost conf.d]# dovecot -n
# 2.0.9: /etc/dovecot/dovecot.conf
# OS: Linux 2.6.32-279.el6.x86_64 x86_64 CentOS release 6.3 (Final)
disable_plaintext_auth = no /*配置文件在/etc/dovecot/conf.d/10-auth.conf
login_trusted_networks = 0.0.0.0/0
mail_location = mbox:~/mail:INBOX=/var/mail/%u /*配置文件在/etc/dovecot/conf.d/10-mail.conf
mbox_write_locks = fcntl /*配置文件在/etc/dovecot/conf.d/10-mail.conf
passdb {
driver = pam
}
ssl_cert = </etc/pki/dovecot/certs/dovecot.pem
ssl_key = </etc/pki/dovecot/private/dovecot.pem
userdb {
driver = passwd
} /*其余配置文件在/etc/dovecot/dovecot.conf
[root @localhost conf.d]#
2.安装和配置postfix软件 yum install -y postfix (Note:postfix配置大部分在/etc/postfix/main.cf下,这里也只需配置该文件即可,根据下面对应修改就好。中英文对译,不是很难,〒_〒)
[root @localhost conf.d]# postconf -n
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
html_directory = no
inet_interfaces = all
inet_protocols = all
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain, pop3.$mydomain, smtp.$mydomain, www.$mydomain
mydomain = abc.com
myhostname = mail.abc.com
mynetworks = 192.168.2.0/24, 192.168.8.0/24, 127.0.0.0/8
mynetworks_style = subnet
myorigin = $mydomain
newaliases_path = /usr/bin/newaliases.postfix
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES
relay_domains = $mydestination
sample_directory = /usr/share/doc/postfix-2.6.6/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
unknown_local_recipient_reject_code = 550
[root @localhost conf.d]# cd ..
3.创建用户进行测试 test0和test1 不多说了。使用fixmail进行测试。
相互发送邮件进行测试