您的位置:首页 > 其它

postfix邮件服务器搭建

2013-05-16 17:01 239 查看
两台不用域不同网段的邮件服务器互发邮件
开三台虚拟机,第一台做192.168.1.0/24网段的vfast.com域的邮件服务器,第二台作为DNS服务器作为两个域的邮件服务器的DNS服务器,第三台作为192.168.2.0/24网段的benet.com域的邮件服务器;第一台网卡桥接方式为VMnet2,第二台两块网卡分别桥接为VMnet2和VMnet3,第三台网卡桥接为VMnet3.(一)首先配置vfast.com域邮件服务器和benet.com域邮件服务器的DNS服务器。1、配置网卡ip地址




2、安装bind,并配置文件[root@localhost ~ ]#yum -y install bind*[root@localhost ~ ]#vim /var/named/chroot/etc/named.conf


3、配置域名解析文件 [root@localhost ~ ]#cp /usr/share/doc/bind-9.3.6/sample/var/named/localdomain.zone/var/named/chroot/var/named/vfast.com.zone[root@localhost ~ ]#vim /var/named/chroot/var/named/vfast.com.zone


[root@localhost ~ ]#cp /usr/share/doc/bind-9.3.6/sample/var/named/localdomain.zone/var/named/chroot/var/named/benet.com.zone[root@localhost ~ ]#vim /var/named/chroot/var/named/benet.com.zone


4、重启named服务,并加入到开机启动项[root@localhost ~ ]#service named restart[root@localhost ~ ]#chkconfig named on5、DNS配置完成(二)配置vfast.com域的邮件服务器1、停止sendmail服务,并设定开机不启动[root@localhost ~ ]#service sendmail stop[root@localhost ~ ]#chkconfig sendmail off2、安装httpd服务,并设定开机启动[root@localhost ~ ]#yum install httpd[root@localhost ~ ]#service httpd restart[root@localhost ~ ]#chkconfig httpd on3、安装postfix,并完成相关配置[root@localhost ~ ]#yum -y install postfix[root@localhost ~ ]#vim /etc/postfix/main.cf


4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd


[root@localhost ~ ]#/etc/init.d/saslauthd restart[root@localhost ~ ]#chkconfig saslauthd on5、创建用户aa,并设置密码为‘123.com’[root@localhost ~ ]#useradd aa[root@localhost ~ ]#echo "123.com" > passwd --stdin aa


[root@localhost ~ ]#vim /etc/postfix/main.cf 在配置文件下面添加如下几行:


[root@localhost ~ ]#service postfix restart 重启动postfix服务[root@localhost ~ ]#chkconfig postfix on 加入到开机启动项6、安装dovecot,并设置开机启动[root@localhost ~ ]#yum -y install dovecot[root@localhost ~ ]#vim /etc/dovecot.conf 解除注释如下两段,并改为此样


[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel


[root@localhost ~ ]#cyradm -u aa localhostIMAP Password: localhost.localdomain>cm user.aa localhost.localdomain>quit
[root@localhost ~ ]#service cyrus-imapd restart[root@localhost ~ ]#chkconfig cyrus-imapd on8、安装squirrelmail并进行webmail的后台相关配置[root@localhost ~ ]#yum -y install squirrelmail[root@localhost ~ ]#/usr/share/squirrelmail/config/conf.plD. Set pre-defined settings for specific IMAP serversd cyrus = Cyrus IMAP servercyrus2. Server Settings2


1vfast.com32r4. General Options4


5yr10. Languages10


1zh_CN2gb23129、vfast.com域的邮件系统就配置完成了(三)配置benet.com域的邮件系统1、停止sendmail服务,并设定开机不启动[root@localhost ~ ]#service sendmail stop[root@localhost ~ ]#chkconfig sendmail off2、安装httpd服务,并设定开机启动[root@localhost ~ ]#yum install httpd[root@localhost ~ ]#service httpd restart[root@localhost ~ ]#chkconfig httpd on3、安装postfix,并完成相关配置[root@localhost ~ ]#yum -y install postfix[root@localhost ~ ]#vim /etc/postfix/main.cf


4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd


[root@localhost ~ ]#/etc/init.d/saslauthd restart[root@localhost ~ ]#chkconfig saslauthd on5、创建用户aa,并设置密码为‘123.com’[root@localhost ~ ]#useradd aa[root@localhost ~ ]#echo "123.com" > passwd --stdin aa[root@localhost ~ ]#vim /etc/postfix/main.cf 在配置文件下面添加如下几行:


[root@localhost ~ ]#service postfix restart 重启动postfix服务[root@localhost ~ ]#chkconfig postfix on 加入到开机启动项6、安装dovecot,并设置开机启动[root@localhost ~ ]#yum -y install dovecot[root@localhost ~ ]#vim /etc/dovecot.conf 解除注释如下两段,并改为此样


[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel


[root@localhost ~ ]#cyradm -u aa localhostIMAP Password: localhost.localdomain>cm user.aa localhost.localdomain>quit
[root@localhost ~ ]#service cyrus-imapd restart[root@localhost ~ ]#chkconfig cyrus-imapd on8、安装squirrelmail并进行webmail的后台相关配置[root@localhost ~ ]#yum -y install squirrelmail[root@localhost ~ ]#/usr/share/squirrelmail/config/conf.plD. Set pre-defined settings for specific IMAP serversd cyrus = Cyrus IMAP servercyrus2. Server Settings2


1benet.com32r4. General Options4


5yr10. Languages10


1zh_CN2gb23129、benet.com域的邮件服务器安装完成(四)测试,不同的域邮件服务器互发邮件测试1、benet.com域服务器的aa用户发一份邮件给vfast.com域邮件服务器的aa用户benet.com域用户aa的发件内容如下:


vfast.com域用户aa收件情况如下:


2、测试vfast.com的域用户aa给benet.com的域用户aa发一封邮件vfast.com域用户的发件内容如下:


benet.com域用户aa收件情况如下:
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息