打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
求助,关于sendmail不能向外网发送邮件的问题????
Redhat AS3+Sendmail+Openwebmail

一 Redhat Linux AS3
   配置要求:
   域名:  gao.org  
   IP:  192.168.1.198
   
1.        配置dns ,能够正常解析gao.org域,本例:www.gao.org  对应IP 192.168.1.198
nslookup –sil  www.gao.org
nslookup –sil  192.168.1.198
来检查正向域名配置是否有误

2. 配置:Sendmail  

/etc/mail/access   
gao.org       (添加域名)
163.com     (允许发往目的地的域名)
192.168.1    (充许 192.168.1.0 网段的用户向外发送邮件)
Fandy不受发送限制(可以无限制的发送和接收Interanl、internet的电子邮件)
修改后用make access.db 生成新的 access.db文件。

/etc/mail/local-host-names  
abc.com(添加域名,收取信件的本地域名)

3.  SMTP配置

/etc/mail/sendmail..cf
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
更改为
O DaemonPortOptions=Port=smtp,Addr=192.168.1.198, Name=MTA
   修改完成后用:netstat –nl 命令查看

4.  POP3 配置

RedHatLinux AS3默认安装的时候并没有安装POP/IMAP,所以你需要安装imap-2002d-2包
rpm –Uvh imap-2002d-2.i386.rpm
为了用户可以使用foxmail,outlook等软件进行收信。您需要安装imap。打开系统的pop3端口。
配置:
/etc/xinetd.d/ipop2
默认:disable=yes 改为:disable=no
/etc/xinetd.d/ipop3
默认:disable=yes 改为:disable=no
/etc/xinetd.d/ipop3
默认:disable=yes 改为:disable=no
/etc/xinetd.d/pops
默认:disable=yes 改为:disable=no

5.  sendmail的性能优化

或许你会收到这样的抱怨,说是当客户端程序运行在防火墙后面的话会发生连接pop端口速度变慢.造成这个延时的原因是你的e-mail服务器初始一个IDENT会话来确认客户端的身份.如果这个询问没有反应,那服务器就会在5秒后发出一个超时信号.这个值可以降低到1秒,从而减少IDENT产生影响

.修改/etc/mail/sendmail.cf文件,把timeout的值改成你想要的值.
# timeouts (many of these)
#O Timeout.ident=5s
改成
O Timeout.ident=1s
到此sendmail配置基本完成。在局域网内,所有用户可以用foxmail,outlook可以在本服务器内发送邮件。

二  Openwebmail

  安装必要的软件包,可以从 http://www.openwebmail.org 下载
    perl-CGI-2.81-88.4.i386.rpm
perl-Compress-Zlib-1.21-RH9.i386.rpm
perl-Text-Iconv-1.2-RH80.i386.rpm
perl-suidperl-5.8.0-88.i386.rpm
MIME-Base64-3.01.tar.gz
openwebmail-2.51-1.i386.rpm
cd /var/www/cgi-bin/openwebmail
ls –l

进入openwebmail下面的etc目录进行相关配置,需要修改以下
1./var/www/cgi-bin/openwebmail /etc/openwebmail.conf
2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf
3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf

1./var/www/cgi-bin/openwebmail/etc/openwebmail.conf [只需修改3处]
releasedate                     20041126
domainnames                     gao.org //默认是auto
auth_module                    auth_unix.pl
mailspooldir                    /var/spool/mail
ow_cgidir                       /var/www/cgi-bin/openwebmail
ow_cgiurl                       /cgi-bin/openwebmail
ow_htmldir                    /var/www/data/openwebmail
ow_htmlurl                    /data/openwebmail
logfile                         /var/log/openwebmail.log

修改语言为中文  将:
default_language                auto
改为:
default_language                zh_CN.GB2312
图标还是英文将其改为中文

default_iconset                        Default
改成:
default_iconset                        Cool3D.Chinese.Simplified

2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf [只需修改2处,把smtpserver和authpop3_server改为相应的IP]

domainnames          auto
smtpserver                 192.168.1..198
smtpport            25
smtpauth           no

enable_pop3             yes
pop3_disallowed_servers        your_server, your_server.domain
pop3_delmail_by_default          yes
pop3_delmail_hidden      no
pop3_usessl_by_default no
authpop3_server                192.168.1.198
authpop3_port           110

3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf[只需修改3处],完整的内容如下:
dbm_ext                      .db
dbmopen_ext                .db
dbmopen_haslock            yes
smtpserver             192.168.1.198 //添加SMTP服务器的IP地址



上面的文件修改完后,再运行./openwebmail-tool.pl –init执行初始化脚本
[root@AS3 openwebmail]#./openwebmail-tool.pl --init
进行初始化后,无需在Apach里发布openwebmail.

用Apache发布opwebmail

初始只能用http://服务器IP/cgi-bin/openwebmail/openwebmail.pl进行访问。
用Apache在80端口发布它,使访问时只需要输入http://服务器IP 或 http://www.gao.org (此例的域名)来进行访问。
写一个 html文件来进行跳转,内容如下
<html>
<body onload=
"window.open('http://your_server/cgi-bin/openwebmail/openwebmail.pl','_top')">
</body>
</html>
或者用:
<html><head>
<meta http-equiv="Refresh"
content="0;URL=http://your_server/cgi-bin/openwebmail/openwebmail.pl">
</head></html>

如果希望使用 http://服务器IP/mail 或 http://域名/mail 的方式,则修改如下:
修改 /etc/http/conf/httpd.conf (最后只采用一种方式)
Redirect /mail   http://域名/cgi-bin/openwebmail/openwebmail.pl
Redirect /mail   http://192.168.1.198/cgi-bin/openwebmail/openwebmail.pl

修改  /etc/httpd/conf/httpd.conf
主页发现图标找不到,想到图标目录还没有做映射再加一句,每当对Apach进行修改后,都要重新配置此项.
Alias /data "/var/www/data"  //自己添加


找到此例发布的80端口,进行修改
<VirtualHost *:80>
        DocumentRoot /var/www/cgi-bin /发布时填写的原始路径,可作为查找对名象
        ServerName _default_:80
        DirectoryIndex index.html index.htm openwebmail.html index.shtml
                <Directory "/var/www/cgi-bin/">
                 AllowOverride None
   
        </Directory>

改为:
<VirtualHost *:80>
        DocumentRoot /var/www/cgi-bin
        ServerName _default_:80
        DirectoryIndex index.html index.htm openwebmail.html index.shtml
                <Directory "/var/www/cgi-bin/">
                 AllowOverride All
       Options ExecCGI
       Order allow,deny
       Allow from all
   
        </Directory>
优化 Apach
MaxClients 150                    同一时间最大连接数,
ServerAdmin gao@gao.org        改为网管的邮箱吧
Timeout 300                       300秒没有反应就断开


Redhat AS4 + Sendmail +openwebmail


一 Redhat Linux AS4
   配置要求:
   域名:  as4.org
   IP:  192.168.1.199
   
2.        配置dns ,能够正常解析as4.org域,本例:www.as4.org  对应IP 192.168.1.199
nslookup –sil  www.as4.org
nslookup –sil  192.168.1.199
来检查正向域名配置是否有误

2. 配置:Sendmail  

/etc/mail/access   
gao.org       (添加域名)
163.com     (允许发往目的地的域名)
192.168.1    (充许 192.168.1.0 网段的用户向外发送邮件)  
Fandy不受发送限制(可以无限制的发送和接收Interanl、internet的电子邮件)
修改后用make access.db 生成新的 access.db文件。
/etc/mail/local-host-names  
as4.org(添加域名,收取信件的本地域名)

3.  SMTP配置

/etc/mail/sendmail..cf
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=127.0.0.1, Name=MTA
更改为
O DaemonPortOptions=Port=smtp,Addr=192.168.1.198, Name=MTA
   修改完成后用:netstat –nl 命令查看

3.        POP3 配置

修改/etc/dovecot.conf文件
将:
#protocols = imap imap3
更改为:
protocols = imap imap3 pop3 pop3s (启动imap imap3 pop3 pop3s功能)

修改完后,用netstat –nl 进行查看

5.  sendmail的性能优化

或许你会收到这样的抱怨,说是当客户端程序运行在防火墙后面的话会发生连接pop端口速度变慢.造成这个延时的原因是你的e-mail服务器初始一个IDENT会话来确认客户端的身份.如果这个询问没有反应,那服务器就会在5秒后发出一个超时信号.这个值可以降低到1秒,从而减少IDENT产生影响

.修改/etc/mail/sendmail.cf文件,把timeout的值改成你想要的值.
# timeouts (many of these)
#O Timeout.ident=5s
改成
O Timeout.ident=1s
到此sendmail配置基本完成。在局域网内,所有用户可以用foxmail,outlook可以在本服务器内发送邮件。

二 Openwebmail

安装必要的软件包,可以从 http://www.openwebmail.org 下载
  perl-5.8.5-12.1.i386.rpm
perl-CGI-SpeedyCGI-2.22-1.2.el4.rf.i386.rpm
perl-Compress-Zlib-1.34-1.2.el4.rf.i386.rpm
perl-suidperl-5.8.5-12.1.1.i386.rpm
perl-Text-Iconv-1.4-1.2.el4.rf.i386.rpm
MIME-Base64-3.01.tar.gz
openwebmail-2.51-1.i386.rpm
cd /var/www/cgi-bin/openwebmail
ls –l

进入openwebmail下面的etc目录进行相关配置,需要修改以下
1./var/www/cgi-bin/openwebmail /etc/openwebmail.conf
2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf
3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf

1./var/www/cgi-bin/openwebmail/etc/openwebmail.conf [只需修改3处]
releasedate                     20041126
domainnames                   as4.org //默认是auto
auth_module                    auth_unix.pl
mailspooldir                    /var/spool/mail
ow_cgidir                       /var/www/cgi-bin/openwebmail
ow_cgiurl                       /cgi-bin/openwebmail
ow_htmldir                    /var/www/data/openwebmail
ow_htmlurl                    /data/openwebmail
logfile                         /var/log/openwebmail.log

修改语言为中文  将:
default_language                 en
改为:
default_language                zh_CN.GB2312
图标还是英文将其改为中文

default_iconset                        Cool3D.Englist
改成:
default_iconset                        Cool3D.Chinese.Simplified

2./var/www/cgi-bin/openwebmail/etc/defaults/openwebmail.conf [只需修改2处,把smtpserver和authpop3_server改为相应的IP]

domainnames          auto
smtpserver                 192.168.1..198
smtpport            25
smtpauth           no

enable_pop3             yes
pop3_disallowed_servers        your_server, your_server.domain
pop3_delmail_by_default          yes
pop3_delmail_hidden      no
pop3_usessl_by_default no
authpop3_server                192.168.1.198
authpop3_port           110

3./var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf[只需修改3处],完整的内容如下:
dbm_ext                      .db
dbmopen_ext                .db
dbmopen_haslock            yes
smtpserver             192.168.1.198 //添加SMTP服务器的IP地址

关闭系统的防火墙和SELinux

上面的文件修改完后,再运行./openwebmail-tool.pl –init执行初始化脚本
[root@AS3 openwebmail]#./openwebmail-tool.pl --init
进行初始化后,无需在Apach里发布openwebmail.

用Apache发布opwebmail

初始只能用http://服务器IP/cgi-bin/openwebmail/openwebmail.pl进行访问。
如果希望使用 http://服务器IP/mail 或 http://域名/mail 的方式,则修改如下:
修改 /etc/http/conf/httpd.conf (最后只采用一种方式)
Redirect /mail   http://域名/cgi-bin/openwebmail/openwebmail.pl
Redirect /mail   http://192.168.1.198/cgi-bin/openwebmail/openwebmail.pl

用Apache在80端口发布它,使访问时只需要输入http://服务器IP 或 http://www.gao.org (此例的域名)来进行访问。
写一个 html文件来进行跳转,内容如下
<html>
<body onload=
"window.open('http://your_server/cgi-bin/openwebmail/openwebmail.pl','_top')">
</body>
</html>
或者用:
<html><head>
<meta http-equiv="Refresh"
content="0;URL=http://your_server/cgi-bin/openwebmail/openwebmail.pl">
</head></html>

修改  /etc/httpd/conf/httpd.conf
AS4系统如果发现图标找不到,需要自己手工指定图片位置,每当对Apach进行修改后,都要重新配置此项.
Alias /data "/var/www/data"  //自己手工添
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
RedHat Linux AS4上邮件服务器的搭建
讓 sendmail 自動回覆信件
Sendmail+Openwebmail
RedHat AS 4.1 + Postfix + dovecot + Apache + OpenWebMail 安装笔记
超级无敌qmail安装大法,详尽之极!
[原创-申请加精] postfix dovecot postfixadmin mysql认证
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服