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地址
![](http://img1.51cto.com/group_attachment/201302071360213970542.png)
![](http://img1.51cto.com/group_attachment/201302071360214054485.png)
2、安装bind,并配置文件[root@localhost ~ ]#yum -y install bind*[root@localhost ~ ]#vim /var/named/chroot/etc/named.conf
![](http://img1.51cto.com/group_attachment/201302071360214655086.png)
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
![](http://img1.51cto.com/group_attachment/201302071360216146259.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360216358293.png)
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
![](http://img1.51cto.com/group_attachment/201302071360220017917.png)
4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd
![](http://img1.51cto.com/group_attachment/201302071360220780265.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360221259098.png)
[root@localhost ~ ]#vim /etc/postfix/main.cf 在配置文件下面添加如下几行:
![](http://img1.51cto.com/group_attachment/201302071360221413571.png)
[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 解除注释如下两段,并改为此样
![](http://img1.51cto.com/group_attachment/201302071360221767688.png)
[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel
![](http://img1.51cto.com/group_attachment/201302071360222078811.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360223059553.png)
1vfast.com32r4. General Options4
![](http://img1.51cto.com/group_attachment/201302071360223297840.png)
5yr10. Languages10
![](http://img1.51cto.com/group_attachment/201302071360223467617.png)
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
![](http://img1.51cto.com/group_attachment/201302071360224419325.png)
4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd
![](http://img1.51cto.com/group_attachment/201302071360220780265.png)
[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 在配置文件下面添加如下几行:
![](http://img1.51cto.com/group_attachment/201302071360221413571.png)
[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 解除注释如下两段,并改为此样
![](http://img1.51cto.com/group_attachment/201302071360221767688.png)
[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel
![](http://img1.51cto.com/group_attachment/201302071360222078811.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360224976997.png)
1benet.com32r4. General Options4
![](http://img1.51cto.com/group_attachment/201302071360225153877.png)
5yr10. Languages10
![](http://img1.51cto.com/group_attachment/201302071360225237320.png)
1zh_CN2gb23129、benet.com域的邮件服务器安装完成(四)测试,不同的域邮件服务器互发邮件测试1、benet.com域服务器的aa用户发一份邮件给vfast.com域邮件服务器的aa用户benet.com域用户aa的发件内容如下:
![](http://img1.51cto.com/group_attachment/201302071360225972913.png)
vfast.com域用户aa收件情况如下:
![](http://img1.51cto.com/group_attachment/201302071360226045544.png)
2、测试vfast.com的域用户aa给benet.com的域用户aa发一封邮件vfast.com域用户的发件内容如下:
![](http://img1.51cto.com/group_attachment/201302071360226237365.png)
benet.com域用户aa收件情况如下:
开三台虚拟机,第一台做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地址
![](http://img1.51cto.com/group_attachment/201302071360213970542.png)
![](http://img1.51cto.com/group_attachment/201302071360214054485.png)
2、安装bind,并配置文件[root@localhost ~ ]#yum -y install bind*[root@localhost ~ ]#vim /var/named/chroot/etc/named.conf
![](http://img1.51cto.com/group_attachment/201302071360214655086.png)
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
![](http://img1.51cto.com/group_attachment/201302071360216146259.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360216358293.png)
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
![](http://img1.51cto.com/group_attachment/201302071360220017917.png)
4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd
![](http://img1.51cto.com/group_attachment/201302071360220780265.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360221259098.png)
[root@localhost ~ ]#vim /etc/postfix/main.cf 在配置文件下面添加如下几行:
![](http://img1.51cto.com/group_attachment/201302071360221413571.png)
[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 解除注释如下两段,并改为此样
![](http://img1.51cto.com/group_attachment/201302071360221767688.png)
[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel
![](http://img1.51cto.com/group_attachment/201302071360222078811.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360223059553.png)
1vfast.com32r4. General Options4
![](http://img1.51cto.com/group_attachment/201302071360223297840.png)
5yr10. Languages10
![](http://img1.51cto.com/group_attachment/201302071360223467617.png)
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
![](http://img1.51cto.com/group_attachment/201302071360224419325.png)
4、设置Saslauthd[root@localhost ~ ]#vim /etc/sysconfig/saslauthd
![](http://img1.51cto.com/group_attachment/201302071360220780265.png)
[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 在配置文件下面添加如下几行:
![](http://img1.51cto.com/group_attachment/201302071360221413571.png)
[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 解除注释如下两段,并改为此样
![](http://img1.51cto.com/group_attachment/201302071360221767688.png)
[root@localhost ~ ]#service dovecot restart[root@localhost ~ ]#chkconfig dovecot on7、安装cyrus-imapd 并完成相关配置[root@localhost ~ ]#yum -y install cyrus-imapd cyrus-imapd-devel
![](http://img1.51cto.com/group_attachment/201302071360222078811.png)
[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
![](http://img1.51cto.com/group_attachment/201302071360224976997.png)
1benet.com32r4. General Options4
![](http://img1.51cto.com/group_attachment/201302071360225153877.png)
5yr10. Languages10
![](http://img1.51cto.com/group_attachment/201302071360225237320.png)
1zh_CN2gb23129、benet.com域的邮件服务器安装完成(四)测试,不同的域邮件服务器互发邮件测试1、benet.com域服务器的aa用户发一份邮件给vfast.com域邮件服务器的aa用户benet.com域用户aa的发件内容如下:
![](http://img1.51cto.com/group_attachment/201302071360225972913.png)
vfast.com域用户aa收件情况如下:
![](http://img1.51cto.com/group_attachment/201302071360226045544.png)
2、测试vfast.com的域用户aa给benet.com的域用户aa发一封邮件vfast.com域用户的发件内容如下:
![](http://img1.51cto.com/group_attachment/201302071360226237365.png)
benet.com域用户aa收件情况如下:
![](http://img1.51cto.com/group_attachment/201302071360226331898.png)
相关文章推荐
- 搭建Linux下邮件服务器(extmail+postfix+clamav)
- Postfix邮件服务器搭建之软件安装与配置
- POSTFIX邮件服务器搭建
- postfix + dovecot + mutt 搭建邮件服务器( 失败原因初步分析 )
- linux 邮件服务器搭建-postfix
- Postfix邮件服务器搭建(一)
- Postfix邮件服务器搭建之虚拟用户配置
- 阿里云CentOS Linux服务器上用postfix搭建邮件服务器
- CentOS7.4中Postfix邮件服务器的搭建(一)-----环境配置及简单搭建
- 邮件服务器搭建 Centos+Postfix+Dovecot+Roundcube
- 阿里云CentOS Linux服务器上用postfix搭建邮件服务器
- 搭建邮件服务器 Postfix + Dovecot (CentOS)
- Postfix邮件服务器搭建(二)
- linux redhat6.5中 搭建Postfix邮件服务器
- postfix邮件服务器搭建
- ubuntu下用postfix搭建邮件服务器
- ubuntu下用postfix搭建邮件服务器
- CentOS Linux服务器上用postfix搭建php邮件服务器
- CentOS 5.5 x64上使用Postfix + Dovecot + MySQL搭建邮件服务器
- Postfix邮件服务器搭建(三)