现在的位置: 首页 > 综合 > 正文

suse配置sendmail222222

2012年06月26日 ⁄ 综合 ⁄ 共 5199字 ⁄ 字号 评论关闭

具体步骤如下:
1、使用rpm命令是否有安装Sendmail软件
suining:~ # rpm -qa|grep sendmail
sendmail-devel-8.12.10-162.1
sendmail-8.12.10-162.1
suining:~ #
若如上,则已经安装,若没有信息出来,则使用YAST来进行安装,期间会提示插入相应安装盘

2、我这里已经安装,接下来
  使用rpm命令确认安装了imap
suining:~ # 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
若如上,则已经安装,若没有信息出来,则使用YAST来进行安装,期间会提示插入相应安装盘
  使用rpm命令确认安装了pop
suining:/etc/xinetd.d # rpm -qa|grep pop
popt-1.7-176.7
qpopper-4.0.5-175.1
若如上,则已经安装,若没有信息出来,则使用YAST来进行安装,期间会提示插入相应安装盘

3、修改/etc/sysconfig/mail这个配置文件,是本机以外的人可以使用该服务器EMAIL,如下:
suining:/etc/sysconfig # more 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<TMPF> -o /etc/mail/access.db')d
nl
在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

然后:
suining:/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地址段的邮件转发
然后:
suining:/etc/mail # makemap hash /etc/mail/access.db < /etc/mail/access
将access里的文件内容转化为/etc/mail/access.db资料库

8、suining:/etc/mail # chkconfig --level 35 sendmail on
   suining:/etc/mail #
运行3,5级别下让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
suining:/etc/init.d # ./xinetd restart
Shutting down xinetd:                                                done
Starting INET services. (xinetd)                                     done
suining:/etc/init.d #

使用如下命令查看状态
suining:/usr/sbin # ./ipop3d status
+OK POP3 suining.js v2003.83 server ready
 
suining:/usr/sbin # ./imapd status
* OK [CAPABILITY IMAP4REV1 LOGIN-REFERRALS STARTTLS LOGINDISABLED] suining.js IMAP4rev1 2003.339 at Sun, 6 Jul 2008 14:30:06 -0700 (PDT)

11、最后重新启动Sendmail服务

suining:/etc/init.d # ./sendmail start
Initializing SMTP port (sendmail)                                    done
suining:/etc/init.d #

12、先本机测试:
suining:~ # telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
220 suining.js ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:41:47 -0700
ehlo aa
250-suining.js 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 suining.js closing connection
Connection closed by foreign host.
说明服务成功启动,并且本机可以使用

suining:~ # telnet 10.38.223.195 25
Trying 10.38.223.195...
Connected to 10.38.223.195.
Escape character is '^]'.
220 suining.js ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:42:35 -0700
ehlo bb
250-suining.js Hello suining.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 suining.js closing connection
Connection closed by foreign host.

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

suining:~ # telnet mail.sina.com 25
Trying 10.38.223.195...
Connected to mail.sina.com.
Escape character is '^]'.
220 suining.js ESMTP Sendmail 8.12.10/8.12.10/SuSE Linux 0.7; Sun, 6 Jul 2008 14:43:41 -0700
ehlo cc
250-suining.js Hello suining.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 suining.js closing connection
Connection closed by foreign host.
说明可以通过域名来使用

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

记住:一定要在/etc/hosts里添加类似如下行
192.168.1.106   study.zzjtlxs.com study

抱歉!评论已关闭.