SuSE mail server configure

    技术2022-05-19  21

    具体步骤如下:

     

    1、使用rpm 命令是否有安装Sendmail 软件

    mySuSE:~ # rpm -qa|grep sendmail

                sendmail-devel-8.12.10-162.1

                sendmail-8.12.10-162.1

    mySuSE:~ #

     

    若如上,则已经安装,若没有信息出来,则使用YAST 来进行安装,期间会提示插入相应安装

     

    2、我这里已经安装,接下来 使用rpm 命令确认安装了imap

    mySuSE:~ # rpm -qa|grep imap

                php4-imap-4.3.4-43.8

                imap-lib-2002e-92.1

                imap-2002e-92.1

                imap-devel-2002e-92.1

    mySuSE:~#

     

    若如上,则已经安装,若没有信息出来,则使用YAST 来进行安装,期间会提示插入相应安装盘

     

    使用rpm 命令确认安装了pop

    mySuSE:/etc/xinetd.d # rpm -qa|grep pop

                popt-1.7-176.7

                qpopper-4.0.5-175.1

    mySuSE:~#

     

    若如上,则已经安装,若没有信息出来,则使用YAST 来进行安装,期间会提示插入相应安装 

     

    3、修改/etc/sysconfig/mail 这个配置文件,是本机以外的人可以使用该服务器EMAIL,如 下:

    mySuSE:/etc/sysconfig # vi mail

     

    ## Path:           Network/Mail/General

    ## Description:

    ## Type:          string

    ## Default:       ""

    ## Config:        postfix

    ## ServiceReload:         sendmail,postfix

    #

    # From:-Line in email and News postings

    # (otherwise the FQDN is used)

    #

    FROM_HEADER=""

    ## Path:           Network/Mail/General

    ## Description: General configuration of mail interface

    ## Type:          yesno

    ## Default:       yes

    ## Config:        sendmail,postfix

    #

    # If you don't want to let SuSEconfig generate your

    # configuration file, set this to no

    #

    MAIL_CREATE_CONFIG="yes"

    ## Type:          yesno

    ## Default:       no

    ## Config:        postfix

    #

    # Set this to "yes" if mail from remote should be accepted

    # this is necessary for any mail server.

    # If set to "no" or empty then only mail from localhost

    # will be accepted.

    #

    SMTPD_LISTEN_REMOTE="yes"              ----原来是 no,一定要改成 yes 才能让其它外部 PC 使用该EMIAL服务器发邮件

     

     

    4、修改Linux.mc 设定档,编辑/etc/mail/Linux.mc 文件

     

    83%处将:

    dnl FEATURE(`authinfo', `hash -o 'AUTH_DIR`/auth-info')dnl

    修改为:

    FEATURE(`access_db', `hash -T -o /etc/mail/access.db')dnl

     

     

    86%处将:

    dnl TRUST_AUTH_MECH(`place_here_your_auth_mechanism')dnl

    dnl define(`confAUTH_MECHANISMS', `place_here_your_auth_mechanism')dnl

    修改为:

    TRUST_AUTH_MECH(`place_here_your_auth_mechanism')dnl

    define(`confAUTH_MECHANISMS', `place_here_your_auth_mechanism')dnl

     

     

    然后:

    mySuSE:/etc/mail # m4 /etc/mail/linux.mc > /etc/sendmail.cf

    生成可用的sendmail.cf

     

     

    5、编辑/etc/sendmail.cf 文件,如下

     

    13%处,将:

    # SMTP client options

    #O ClientPortOptions=Family=inet, Address=0.0.0.0

    修改为:

    # SMTP client options

    O ClientPortOptions=Family=inet, Address=10.38.223.195             ---本机的IP

     

     

    6、编辑/etc/mail/local-host-names, 加入本机域名

     

    # Format:

    #

    #<aliases for local host>

     

    mail.sina.com

    sina.com

     

     

    7、编辑/etc/mail/access,加入

    # Default for loop back is RELAY

    127       RELAY

    10.38.223          RELAY

    允许10.38.223 地址段的邮件转发

     

    然后:

    mySuSE:/etc/mail # makemap hash /etc/mail/access.db < /etc/mail/access

    access 里的文件内容转化为/etc/mail/access.db 资料库

     

     

    8mySuSE:/etc/mail # chkconfig --level 35 sendmail on

         mySuSE:/etc/mail #

     

    runlevel 3级别下让sendmail 服务开机自动加载

     

     

    9、查看/etc/services,确保:

    smtp     25/tcp   mail      # Simple Mail Transfer

    smtp     25/udp  mail      # Simple Mail Transfer

    pop3     110/tcp             # Post Office Protocol - Version 3

    pop3     110/udp            # Post Office Protocol - Version 3

     

    前的#号没有被注释掉

     

     

    10、编辑/etc/xinetd.d 下的imap 文件,修改如下:

    # imap - imap mail daemon

    #

    service imap

    {

                disable              = yes ---------修改为no

                socket_type       = stream

                protocol             = tcp

                wait                  = no

                user                  = root

                server               = /usr/sbin/imapd

                flags                 = IPv4

    }

     

     

    编辑/etc/xinetd.d 下的qpopper 文件,修改如下:

    # qpopper - pop3 mail daemon

    #

    service pop3

    {

                disable              = yes ----------修改为no

                socket_type       = stream

                protocol             = tcp

                wait                  = no

                user                  = root

                server               = /usr/sbin/popper

                server_args       = -s

                flags                 = IPv4

    }

    ~

     

    接着重新启动xinetd

    mySuSE:/etc/init.d # ./xinetd restart

                Shutting down xinetd:                             done

                Starting INET services. (xinetd)               done

    mySuSE:/etc/init.d #

     

    使用如下命令查看状态

    mySuSE:/usr/sbin # ./ipop3d status

                +OK POP3 mySuSE.js v2003.83 server ready

     

    mySuSE:/usr/sbin # ./imapd status

    * OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS LOGINDISABLED] mySuSE IMAP4rev1 2003.339 at Sun, 6 Jul 2008 14:30:06 -0700 (PDT)

     

    11、最后重新启动Sendmail 服务

    mySuSE:/etc/init.d # ./sendmail start

                Initializing SMTP port (sendmail)                          done

    mySuSE:/etc/init.d #

     

    12、先本机测试:

    mySuSE:~ # telnet 127.0.0.1 25

                Trying 127.0.0.1...

                Connected to 127.0.0.1.

                Escape character is '^]'.

                220 mySuSE ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:41:47 -0700

                ehlo aa

                250-mySuSE Hello localhost [127.0.0.1], pleased to meet you

                250-ENHANCEDSTATUSCODES

                250-PIPELINING

                250-8BITMIME

                250-SIZE

                250-DSN

                250-ETRN

                250-DELIVERBY

                250 HELP

                quit

                221 2.0.0 mySuSE closing connection

                Connection closed by foreign host.

                说明服务成功启动,并且本机可以使用

     

    mySuSE:~ # telnet 10.38.223.195 25

                Trying 10.38.223.195...

                Connected to 10.38.223.195.

                Escape character is '^]'.

                220 mySuSE ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:42:35 -0700

                ehlo bb

                250-mySuSE Hello mySuSE.js [10.38.223.195], pleased to meet you

                250-ENHANCEDSTATUSCODES

                250-PIPELINING

                250-8BITMIME

                250-SIZE

                250-DSN

                250-ETRN

                250-DELIVERBY

                250 HELP

                quit

                221 2.0.0 mySuSE closing connection

                Connection closed by foreign host.

                说明其它PC 可以通过该IP 来使用EMAIL 服务

     

    mySuSE:~ # telnet mail.sina.com 25

                Trying 10.38.223.195...

                Connected to mail.sina.com.

                Escape character is '^]'.

                220 mySuSE ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:43:41 -0700

                ehlo cc

                250-mySuSE Hello mySuSE.js [10.38.223.195], pleased to meet you

                250-ENHANCEDSTATUSCODES

                250-PIPELINING

                250-8BITMIME

                250-SIZE

                250-DSN

                250-ETRN

                250-DELIVERBY

                250 HELP

                quit

                221 2.0.0 mySuSE closing connection

                Connection closed by foreign host.

                说明可以通过域名来使用

     

    然后可以创建用户,使用WINDOWS outlook 客户端来做测试。

     

    记住:一定要在/etc/hosts 里添加类似如下行

    192.168.1.106    study.zzjtlxs.com            study

     

     

    可能需要從網上下載的rpm

     

    ftp://rpmfind.net/linux/opensuse/update/11.0/rpm/i586/imap-2006c1_suse-100.3.i586.rpm

    ftp://rpmfind.net/linux/opensuse/update/11.0/rpm/i586/imap-lib-2006c1_suse-100.3.i586.rpm

     


    最新回复(0)