主要分以下步骤:
1)关闭sendmail
2)用yum安装bind-*即DNS的配置
3)yum安装postfix,配置其主配置文件/etc/postfix/main.cf
4)安装cyrus-sasl,配置/etc/sysconfig/saslauthd
5)安装dovecot并进行配置
6)安装cyrus-imapd进行配置
7)安装webmial主要是sqairrelmail的配置
8)登陆webmial服务器进行相关的验证
具体步骤如下:
1)service sendmail stop //chkconfig sendmail off
2)安装DNS,yum install bind-*
a)复制named.conf模板:cp -p /usr/share/doc/bind-9/sample/etc/named.conf /var/named/chroot/etc/named.conf
vim /var/named/chroot/etc/named.conf
options {
directory "/var/named/";
};
zone "vfast.com" {
type master;
file "vfast.com.zone";
};
:wq!
b) cp -p /usr/share/doc/bind-9/sample/var/named/localdomain.zone /var/named/chroot/var/named/vfast.com.zone
vim /var/named/chroot/var/named/vfast.com.zone
@ IN SOA mail.vfast.com. root.vfast.com. (
2013091202 ;
3H ;
15M ;
1W ;
1D ) ;
vfast.com. IN NS mail.vfast.com.
mail.vfast.com. IN A 192.168.8.10
vfast.com. IN MX 10 mail.vfast.com.
:wq!
service named restart
3) 安装postfix ,yum install postfix
vim /etc/postfix/main.cf
myhostname = mail.vfast.com //69
mydomain = vfast.com //77
myorigin = $mydomain //93
inet_interfaces = all //107
#inet_interfaces = localhost //110
mydestination = $myhostname,$mydomain //155
mynetworks = 192.168.8.0/24,127.0.0.0/8 //255
relay_domains = vfast.com //287
4)yum install cyrus-sasl
vim /etc/sysconfig/saslauthd
MECH = shadow
5)service saslauthd restart // chkconfig saslauthd on
6)useradd test //passwd test 密码也为test
testsaslauthd -u test -p test
7)vim /etc/postfix/main.cf
末行添加如下6行内容进行SMTP和postfix的整合
smtpd_sasl_auth_enable = yes //开启SMTP功能验证
smtpd_sasl_local_domain = '' //验证本域的
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
broken_sasl_auth_clients = yes //打破客户端的验证
smtpd_client_restrictions = permit_sasl_authenticated //客户端的验证
smtpd_sasl_security_options = noanonymous //不允许匿名用户登录
8) service postfix restart //chkconfig postfix on
9) yum install dovecot
vim /etc/dovecot.conf
protocols = pop3 pop3s
protocol pop3 {
listen = *:10100
# ..
}
:wq!
10)service dovecot restart //chkconfig dovecot on
11)yum install cyrus-imapd //后台管理用户的邮箱
cyrus passwd 密码为123456
cyradm -u cyrus localhost
输入密码123456然后创建用户 cm user.test 退出quit
12)yum install squirrelmail
/usr/share/squirrelmail/config/config.pl
d----cyrus
2---1--vfast.com 3---2--s-
4---5--true
10--1--zh-CN 2--gb2312
r---s--q
service httpd restart
13) vim /etc/postfix/main.cf
mailbox_transport = lmtp:unix:/var/lib/imap/socket/lmtp 将#注释掉
service postfix restart
14)
用户和密码均是test进行收发邮件的测试