文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>RHEL 4.4 + Postfix + dovecot+ SASL + Apache + Open

RHEL 4.4 + Postfix + dovecot+ SASL + Apache + Open

时间:2010-07-20  来源:linscora

作者:fandy
电子邮箱:[email protected]
QQ:332018422
建立日期:2005年10月01日,最后修改日期:2006年12月13日
       版权说明:本文章的内容归作者版权所有,同时也接受大家的转贴,但一定要保存作者信息和出处,多谢!

在Red Hat Enterprise Linux 4.4 系统中MTA服务的软件有许多,常用“Sendmail、Qmail、Postfix”等软件,本文使用Red Hat Enterprise Linux 4.4 + Postfix + SASL + dovecot + Apache + OpenWebMail + IMSS制作一个集POP和WebMail等功能的电子邮件系统,希望可以解决大家在同类安装时减少一般不必要的错误啦!(注以下的操作请使用root用户来进行)

Step0、实验环境:

       网络域名:nseasy.net
       DNS主机名称:mail.nseasy.net
       DNS主机IP地址:192.168.1.254
       邮件主机名称:mail.nseasy.net
       邮件主机IP地址:192.168.1.254
       操作系统:RedHat Enterprise Server 4.4中文版


       操作系统安装过程注意事项截图:
      
       无防火墙和不启动SELinux服务:
      
       连接软件包组时,全选“开发工具”项目内的所有内容;


Step1、DNS服务器的配置:

       参考资料“Red Hat Enterprise Linux 4.1下配置BIND -9.2.4-2安装笔记”
       连接地址:http://www.gd-linux.com/bbs/showthread.php?t=2866


Step2、安装所需要的软件清单:

       postfix-2.2.5-3.rhel4.rpm  
       postfix-pflogsumm-2.1.5-4.2.rhel4.rpm  
       cyrus-sasl-2.1.19-5.rhel4.i386.rpm  
       dovecot-0.99.11-2.rhel4.1.rpm  
       httpd-2.0.52-12.ent.rpm  
       perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm
       perl-suidperl-5.8.5-12.1.1.i386.rpm
       perl-Compress-Zlib-1.34-1.2.el4.rf.i386.rpm
       perl-CGI-SpeedyCGI-2.22-1.2.el4.rf.i386.rpm
       perl-5.8.5-12.1.i386.rpm
       openwebmail-2.51-1.i386.rpm
      
--------------------------------------------------------------------------------------------------
说明:软件清单中的postfix+cyrus-sasl+dovecot+httpd也可以在安装系统时一起安装。
       安装openwebmail 2.51系统所需要的软件可以到下列地址下载:
       http://openwebmail.org/openwebmail/download/redhat/rpm/release
--------------------------------------------------------------------------------------------------


Step3、postfix的安装过程:
      
       #killall sendmail  (停止所有的Sendmaail进程)
       sendmail: no process killed
              # rpm -ivh postfix-2.2.5-3.rhel4.i386.rpm
       Preparing...     ########################################### [100%]
              1:postfix        ##################################### [100%]
       链接 /usr/share/man/man8/sendmail.8.gz 到从mta-sendmailman(/usr/share /man/man1/
       sendmail.1.gz mta-sendmailman)不正确


Step4、启动postfix + dovecot服务过程:
      
       # service postfix start
       Starting postfix:                                          [  确定  ]
      
       # service dovecot start
       启动 Dovecot Imap:                                     [  确定  ]
      

Step5、修改/etc/dovecot.conf文件:

       #protocols = imap imap3
       更改为:
       protocols = imap imap3 pop3 pop3s (启动imap imap3 pop3 pop3s功能)
      
       # service dovecot restart(重新启动dovecot服务)
       停止 Dovecot Imap:                                        [  确定  ]
       启动 Dovecot Imap:                                        [  确定  ]
      

Step6、修改/etc/postfix/main.cf文件:

       #myhostname = host.domain.tld
       更改为:
       myhostname = mail.nseasy.net (指定运行Postfix邮件系统的主机名称)
      
       #mydomain = domain.tld
       更改为:
       mydomain = nseasy.net (指定Postfix邮件系统使用的域名比例:easy.com)
      
       #myorigin = $mydomain
       更改为:
       myorigin = nseasy.net (指定发件人所在的域名比例:easy.com)
      
       #inet_interfaces = all
       更改为:
       Inet_interfaces =all (指定Postfix邮件系统监视的网络接口)
      
       #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain
       更改为:
       mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain, mail.$mydomain(指定Postfix接收邮件时收件人的域名)
      
       #mynetworks = host
       更改为:
       mynetworks = host (指定您所在的网络地址)
      
       # service postfix restart (重新启动postfix服务)
       Shutting down postfix:                                     [  确定  ]
       Starting postfix:                                            [  确定  ]


Step7、端口测试:

       # telnet mail.nseasy.net 25 (测试25端口)Trying 127.0.0.1...
       Connected to localhost.localdomain (127.0.0.1).
       Escape character is '^]'.
       220 mail.easy.com ESMTP Postfix
       quit
       221 Bye
       Connection closed by foreign host.

       # telnet nseasy.net 110 (测试110端口)Trying 127.0.0.1...
       Connected to localhost.localdomain (127.0.0.1).
       Escape character is '^]'.
       +OK dovecot ready.
       quit
       +OK Logging out
       Connection closed by foreign host.


Step8、安装openwebmail 2.51软件:

       # service httpd restart (启动httpd服务)
       停止 httpd:                                               [  确定  ]
       启动 httpd:                                               [  确定  ]
      
       # rpm -ivh perl-5.8.5-12.1.i386.rpm
       # rpm -ivh perl-CGI-SpeedyCGI-2.22-1.2.el4.rf.i386.rpm
       # rpm -ivh perl-Compress-Zlib-1.34-1.2.el4.rf.i386.rpm
       # rpm -ivh perl-suidperl-5.8.5-12.1.1.i386.rpm
       # rpm -ivh perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm
      
# rpm -ivh openwebmail-2.51-1.i386.rpmwarning: openwebmail-2.51-1.i386.rpm: V3 DSA signature: NOKEY, key ID cfb164d8
       Preparing...   ######################################### [100%]
       1penwebmail   ###################################### [100%]
              
       You may login with non-root account from
       http://mail.easy.com/cgi-bin/openwebmail/openwebmail.pl
      
       # cd /var/www/cgi-bin/openwebmail/
       # ./openwebmail-tool.pl --init
      
       Please change './etc/dbm.conf' from
      
       dbm_ext                 .db
       dbmopen_ext             none
       dbmopen_haslock         no
      
       to
      
       dbm_ext                 .db
       dbmopen_ext             .db
       dbmopen_haslock         no
      
      
       And execute './openwebmail-tool.pl --init' again!
      
       ps: If you are running openwebmail in persistent mode,
           don't forget to 'touch openwebmail*.pl', so speedycgi
           will reload all scripts, modules and conf files in --init.

      
Step9、修改 /var/www/cgi-bin/openwebmail/etc/openwebmail.conf 文件:
      
       domainnames         auto
       更改为:
       domainnames         nseasy.net (更改为自己定义的域名)
      
       default_language             en
       更改为:
       default_language       zh_CN.GB2312 (更改为简体中文版介面)
      
       default_iconset        Cool3D.Englist
       更改为:
       default_iconset        Cool3D.Chinese.Simplified (更改为中文3D按键)


Step10、修改/var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf文件:

       smtpserver                 127.0.0.1
       更改为:
       smtpserver                 192.168.1.254 (更改smtp服务器的地址)
      
       authpop3_server                localhost
       更改为:
       authpop3_server                192.168.1.254 (更改pop3服务器的地址)

      
Step11、修改/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf文件:
      
       dbmopen_ext           none
       更改为:
       dbmopen_ext           .db
      
       dbmopen_haslock       no
       更改为:
       dbmopen_haslock       yes
      
       smtpserver             192.168.1.254 (添加smtp服务器的地址)
      

Step12、继续运行openwebmail-tool.pl文件:

       # ./openwebmail-tool.pl --init
      
       creating db /var/www/cgi-bin/openwebmail/etc/maps/b2g ...done.
       creating db /var/www/cgi-bin/openwebmail/etc/maps/g2b ...done.
       creating db /var/www/cgi-bin/openwebmail/etc/maps/lunar ...done.
       Welcome to the Open WebMail!
      
       This program is going to send a short message back to the developer,
       so we could have the idea that who is installing and how many sites are
       using this software, the content to be sent is:
      
       OS: Linux 2.6.9-11.EL i686
       Perl: 5.008005
       WebMail: Open WebMail 2.51 20050228
      
       Send the site report?(Y/n) y (输入y,然后按回车键)
       sending report...
      
       Thank you.
      

Step13、增加限制用户发送电子邮的权限:
      
       用户权限说明:
       Fandy不受发送限制(可以无限制的发送和接收Interanl、internet的电子邮件);
       Yer、Biao受到发送限制(只可以发送和接收Internal内的电子邮件);
      
       # useradd fandy(增加本地用户:fandy)
       # useradd yer(增加本地用户:yer)
       # useradd biao(增加本地用户:biao)
      
       # passwd yer(设置本地yer用户的密码)
       Changing password for user yer.
       New UNIX password:
       Retype new UNIX password:
       passwd: all authentication tokens updated successfully.
      
       # passwd fandy(设置本地fandy用户的密码)
       Changing password for user fandy.
       New UNIX password:
       Retype new UNIX password:
       passwd: all authentication tokens updated successfully.
      
       # passwd biao(设置本地biao用户的密码)
       Changing password for user biao.
       New UNIX password:
       Retype new UNIX password:
       passwd: all authentication tokens updated successfully.
      
       在main.cf文件中增加以下的代码:
      
       # restrictions
       smtpd_restriction_classes = local_only
       local_only = check_recipient_access hash:/etc/postfix/local_domains, reject

       smtpd_recipient_restrictions =check_sender_access hash:/etc/postfix/local_senderspermit_mynetworks,permit_sasl_authenticated,reject_non_fqdn_sender,reject_non_fqdn_recipient,reject_unauth_destination,reject_unauth_pipelining,reject_invalid_hostname
      
       在/etc/postfix/目录下建立local_senders文件,内容如下:
      
       [email protected]      local_only
       [email protected]     local_only
      
       在/etc/postfix/目录下建立local_domains文件,内容如下:
      
       easy.com            OK
       mail.easy.com       OK
      
       为local_senders、local_domains两个文件建立hash:
      
       # postmap hash:/etc/postfix/local_senders
       # postmap hash:/etc/postfix/local_domains
      
       当[email protected][email protected]两个用户向其它域发送邮件时会出现以下的
       错误信息:
      
       554 5.7.1 <[email protected]>: Sender address rejected: Access denied
       554 5.7.1 <[email protected]>: Sender address rejected: Access denied
      

Step14、测试webmail方式收发电子邮件:

       在ie中输入以下地址:
       http://mail.easy.com/cgi-bin/openwebmail/openwebmail.pl


Red Hat Enterprise Linux 4.4 + Postfix + dovecot + SASL + Apache + OpenWebMail + IMSS安装笔记学习教程已经可能下载啦!

下载文件的大少为75130kb(即为75M)

下载地址:http://www.nseasy.net/video/Postfix.rar

Video文件顺序说明:

System Installation.avi 操作系统的安装过程视频记录文档;

DNS Service Setup.avi 配置网络系统中的DNS服务器视频记录文档;

Testing SASL authentication.avi 测试系统用户使用SASL认证是否通过;

Dovecot Service Setup.avi 配置POP3服务器视频记录文档;

Postfix Service Setup.avi 配置MTA服务器视频记录文档;

Openwebmail Installation.avi 安装和配置openwebmail应用软件视频记录文档;

Testing Email System.avi 测试用户通过用户认证方式和用户限制功能是否可以正常收以电子邮件视频记录文档;

IMSS Service Installation.avi 安装IMSS邮件网关软件视频记录文档;

IMSS Service Setup.avi 配置IMSS邮件网关和Postfix MTA软件结合一起工作视频记录文档;

Testing AntVir Email System.avi 测试IMSS邮件网关和Postfix MTA对带病毒邮件查杀病毒效果视频记录文档;
相关阅读 更多 +
排行榜 更多 +
全民飞机空战手机版

全民飞机空战手机版

飞行射击 下载
弗拉格职业射手手机版

弗拉格职业射手手机版

飞行射击 下载
反射单元2

反射单元2

飞行射击 下载