1。查看OS环境
[root@gaudi tmp]# lsb_release -a
LSB Version: :core-3.0-ia32:core-3.0-noarch:graphics-3.0-ia32:graphics-3.0-noarch
Distributor ID: CentOS
Description: CentOS release 4.4 (Final)
Release: 4.4
Codename: Final
[root@gaudi tmp]# uname -a
Linux gaudi.ap.sony.com 2.6.9-42.ELsmp #1 SMP Sat Aug 12 09:39:11 CDT 2006 i686 i686 i386 GNU/Linux
2。安装Sendmail
[root@gaudi tmp]#rpm -qa | grep send
RPM download:
安转软件:
[root@gaudi tmp]# rpm -ivh sendmail-cf-8.8.7-12.i386.rpm
警告: sendmail-cf-8.8.7-12.i386.rpm: V3 RSA/MD5 signature: NOKEY, key ID cba29bf9
Preparing... ########################################### [100%]
1:sendmail-cf ########################################### [100%]
[root@gaudi tmp]# rpm -qa | grep send
sendmail-8.13.1-3.RHEL4.5
sendmail-cf-8.13.1-3.3.el4
PS:卸载软件命令
rpm-e <文件名>
3。启动Sendmail服务
[root@gaudi ~]# sendmail -bd -q12h
后跟的参数解释如下:
-b:设定Sendmail服务运行于后台。
-d:指定Sendmail以Daemon(守护进程)方式运行。
-q:设定当Sendmail无法成功发送邮件时,就将邮件保存在队列里,并指定保存时间。上面的12h表示保留12小时。
检测Sendmail服务器是否正常运行
[root@gaudi ~]# /etc/rc.d/init.d/sendmail status
sendmail (pid 6617) を実行中...
4。配制Sendmail
1)用模板文件sendmail.mc生成sendmail.cf配置文件,并导出到/etc/mail/目录下:
[root@gaudi tmp]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@gaudi tmp]#
2)重启sendmail
[root@gaudi ~]# /etc/rc.d/init.d/sendmail restart
sendmail を停止中: [ OK ]
sm-client を停止中: [失敗]
sendmail を起動中: [ OK ]/etc/rc.d/init.d/sendmail restart
sm-client を起動中: [ OK ]
[root@gaudi ~]#
[root@gaudi ~]# netstat -atn
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 0.0.0.0:523 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:1521 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:2100 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:23 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:32795 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:991 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:1521 127.0.0.1:32796 ESTABLISHED
5。创建邮件的帐户
建立用户
[root@gaudi ~]# adduser gaudiMail -p pass
[root@gaudi log]# pwd
/var/log
*****************************************
问题集:
按照文档配置sendmail的时候,在重新生成sendmail.cf时,,修改了sendmail.mc
m4 sendmail.mc > sendmail.cf
却提示 sendmail.mc:10: m4: Cannot open /usr/share/sendmail-cf/m4/cf.m4: No such file or directory
这是因为没有安装sendmai-cf这个包
安装完成后问题解决