sendmail配置一路通

我的博客:http://wqmsl.blog.51cto.com  <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

                 *****第一部分******

       sendmail的安装

、编辑vi /etc/resolv.conf   添加mail主机的DNS地址(例如:nameserver   

    192.168.0.5

2、编辑vi /etc/sysconfig/network,更改mail主机的名称           

HOSTNAME=mail.msl.com

3reboot   重启系统

4、挂载系统光盘 mount /dev/cdrom  默认到/media/cdrom下面

     切换到RPMS目录下:cd/media/cdrom/RedHat/RPMS

5、安装sendmail所需要的组件

     [root@mail6 ~]#rpm -ivh sendmail-doc-8.13.1-3.3.el4.i386.rpm 

sendmail-cf-8.13.1-3.3.el4.i386.rpm 

6、检查sendmail安装情况

     [root@mail6 ~]# rpm -qa | grep sendmail*

     sendmail-8.13.1-3.3.el4

     sendmail-cf-8.13.1-3.3.el4

     sendmail-doc-8.13.1-3.3.el4

7、设置“local-host-names”文件:

   [root@localhost ~]# vi /etc/mail/local-host-names                     

   # local-host-names - include all aliases for your machine here.

   wqmsl.com

8、编辑sendmail的主要配置文件

     [root@localhost ~]# vi /etc/mail/sendmail.mc

     找到DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl   

    修改127.0.0.10.0.0.0

9、找到以下两行

     dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN 

PLAIN')dnl

     dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 

CRAM-MD5 LOGIN PLAIN')dnl

   去掉前面的注释  dnl

10、检测sasl的安装情况,总计7个为正常

    [root@mail6 mail]# rpm -qa |grep sasl*

    cyrus-sasl-2.1.19-14

    cyrus-sasl-plain-2.1.19-14

    cyrus-sasl-md5-2.1.19-14

    cyrus-sasl-gssapi-2.1.19-14

    cyrus-sasl-sql-2.1.19-14

    cyrus-sasl-devel-2.1.19-14

    cyrus-sasl-ntlm-2.1.19-14

11、设置saslauthd的启动级别为3 5 自动启动

    [root@mail6 mail]# chkconfig --level 35 saslauthd on

    启动saslauthd

    [root@mail6 mail]# service saslauthd start

12、建立邮件用户组和邮件用户并设置密码

    [root@mail6 mail]# groupadd mailuser

    [root@mail6 mail]# useradd -g mailuser -s /sbin/nologin mail10

    [root@mail6 mail]# useradd -g mailuser -s /sbin/nologin mail11

    passwd mail10

    passwd mail11

    -s/sbin/nologin   是指定用户的shell,使邮件用户只能发送接收邮件等操作

而不能登陆到mail服务器

13、访问控制设置relay

     [root@localhost ~]# cat /etc/mail/access# by default we allow 

relaying from         localhost...localhost.localdomain           RELAY

    localhost                       RELAY

    127.0.0.1                       RELAY

     本段的IP(可不完全)

例:192.168.0     RELAY(允许)| reject(拒绝,退信)| DISCARD(直接

丢弃)

     一般我们使用DISCARD,直接丢弃掉,使用拒绝会占用一部分带宽去退信

    使用makemap更新     [root@mail6 mail]# makemap hash access.db 

<access

14、生成Sendmail.cd文件:[root@localhost ~]# cd /etc/mail       

       一定要进入/etc/mail命令才能执行m4命令;

      [root@localhost mail]# m4 sendmail.mc> sendmail.cf

15、重启Sendmail服务器:[root@localhost mail]# service sendmail restart

16[root@mail6 mail]# netstat -ntpl |grep 25

       tcp        0      0 0.0.0.0:25                  0.0.0.0:*                   LISTEN      

5751/sendmail: acce 

       [root@mail6 mail]# netstat -ntpl |grep 110

       [root@mail6 mail]# cd /media/cdrom/RedHat/RPMS/

       [root@mail6 RPMS]#rpm -ivh dovecot-0.99.11-9.EL4.i386.rpm 

17[root@mail6 RPMS]# chkconfig --level 35 dovecot on

       [root@mail6 RPMS]# service dovecot start

        Starting Dovecot Imap: [  OK  ]

18vi  /etc/dovecot.conf

      找到     #protocols = imap imaps

       改为     protocols = pop3 pop3s imap imaps

       重启dovecot服务   [root@mail6 RPMS]# service dovecot restart

                                                                                                  ******第二部分*******

      openwebmail的安装

1[root@mail6 RPMS]# rpm -ivh openwebmail-2.51-1.i386.rpm perl-     

suidperl-5.8.5-36.RHEL4.i386.rpm perl-Compress-Zlib-1.42-     

1.el4.rf.i386.rpm perl-Text-     Iconv-1.4-1.2.el4.rf.i386.rpm perl-CGI-          

SpeedyCGI-2.22-1.2.el4.rf.i386.rpm 

     warning: openwebmail-2.51-1.i386.rpm: V3 DSA signature: NOKEY, key 

     ID cfb164d8

     warning: perl-suidperl-5.8.5-36.RHEL4.i386.rpm: V3 DSA signature:      

NOKEY, key ID db42a60e

     warning: perl-Compress-Zlib-1.42-1.el4.rf.i386.rpm: V3 DSA signature:   

   NOKEY, key ID 6b8d79e6

     Preparing...                

########################################### 

[100%]

    1:perl-Text-Iconv        

########################################### [ 

20%]

    2:perl-Compress-Zlib     

########################################### [ 

40%]

    3:perl-suidperl          

########################################### [ 

60%]

    4:openwebmail            

########################################### [ 

80%]

You may login with non-root account from

http://mail6.msl.com/cgi-bin/openwebmail/openwebmail.pl

 5:perl-CGI-SpeedyCGI     

########################################### 

[100%]

2、添加生成dbm.confvi  /var/www/cgi-bin/openwebmail/etc

     dbm_ext                .db

     dbmopen_ext         .db

     dbmopen_haslock    no

     只有添加之后才可以进行后面的一步

3[root@mail6 ~]# /var/www/cgi-bin/openwebmail/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-78.ELsmp i686

   Perl: 5.008005

   WebMail: Open WebMail 2.51 20050228

   Send the site report?(Y/n) y

   sending report...

   Thank you.

4、安装Linux自带的Apache并启动,因为自带的Apache的文档目录

/var/www/下,编译安装的话编辑httpd.conf,修改文档目录到/var/www/

下。

    [root@mail6 RPMS]# rpm -ivh httpd-2.0.52-41.ent.i386.rpm httpd-

suexec-2.0.52-41.ent.i386.rpm apr-util-0.9.4-22.el4.i386.rpm 

    [root@mail6 RPMS]# service httpd restart

5、修改配置文件中的设置项:

     [root@mail ~]# vi /var/www/cgi-

bin/openwebmail/etc/openwebmail.conf//将下列

    domainnames                      auto//改成    

  domainnames                      你的域名(wqmsl.com

  /将下列

  default_language                  en//改成                             

   default_language                    zh_CN.GB2312

  //将下列

  default_iconset                     Cool3D.English//改成           

   default_iconset                       Cool3D.Chinese.Simplified

6[root@mail6 RPMS]# chkconfig --list sendmail

     sendmail        0:off   1:off   2:on    3:off   4:on    5:off   6:off

     [root@mail6 RPMS]# chkconfig --level 35  sendmail on

7、最后检查所有的服务的启动情况,设置开机启动。

所有的安装都完成了,最后有一些常见的问题

1sendmail启动速度慢,这是因为sendmail解析DNS失败或者解析不到,设

sendmail服务器的正向和反向解析,自然启动就会快。

2、不能向外网或者是其他域发送和接收邮件(前提:本机是发布在公网上,

又合法的域名和MX解析),那就查看一下你sendmail的配置文件

sendmail.mc的配置是否正确。

3、如果你的是公网上的邮件服务器,关闭本机的relay,否则肯能很快你的

邮件服务器就被放入黑名单了。

                       我的博客:http://wqmsl.blog.51cto.com 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值