Sendmail 简单配置(1)
RHEL5.3 基本网络配置
一、
1 、RHEL5 U3:如图1
clip_p_w_picpath002
(如图1)
2 、#hostname //查看当前主机的主机名:如图2
clip_p_w_picpath003
(如图2)
3 、#vi /etc/sysconfig/network-scripts/ifcfg-eth0 编辑指定网络接口配置文件:如图3
clip_p_w_picpath005
(如图3)
4 、#vi /etc/sysconfig/network 通过配置文件修改主机名:如图4
clip_p_w_picpath007
(如图4)
5 、在终端字符界面修改其字体和中文字体大小:如图5
clip_p_w_picpath009
(如图5)
6 、挂载光盘:如图6
clip_p_w_picpath011
(如图6)
7 、查看OpenSSH是否安装:如图7
clip_p_w_picpath013
(如图7)
8 #vi /etc/hosts 设置本地 DNS 解析文件: 如图8
clip_p_w_picpath015
(如图8)
9 #vi /etc/resolv.conf 指定当前主机的 DNS 服务器,最多可指定三个: 如图9
clip_p_w_picpath017
(如图9)
10 、关闭iptables防火墙:如图10
clip_p_w_picpath018
clip_p_w_picpath020
clip_p_w_picpath022
clip_p_w_picpath024
(如图10)
二、DNS 简单配置
1 、vim /etc/named.conf
clip_p_w_picpath026
2 、vim /var/named/benet.com.zone
clip_p_w_picpath028
3 、vim /var/named/1.168.192.in-addr.arpa.zone
clip_p_w_picpath030
4 、nslookup 查看
clip_p_w_picpath031
三、sendmail 简单配置
1、 安装 sendmail
root@dns ~]# mount /dev/hdc /mnt/dvd/
mount: block device /dev/hdc is write-protected, mounting read-only
[root@dns ~]# cd /mnt/dvd/Server/
[root@dns Server]# rpm -qa | grep sendmail
sendmail-8.13.8-2.el5
[root@dns Server]# ls sendmail*
sendmail-8.13.8-2.el5.i386.rpm sendmail-devel-8.13.8-2.el5.i386.rpm
sendmail-cf-8.13.8-2.el5.i386.rpm sendmail-doc-8.13.8-2.el5.i386.rpm
[root@dns Server]# rpm -ivh --aid sendmail-cf-8.13.8-2.el5.i386.rpm
warning: sendmail-cf-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-cf ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-devel-8.13.8-2.el5.i386.rpm
warning: sendmail-devel-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-devel ########################################### [100%]
[root@dns Server]# rpm -ivh --aid sendmail-doc-8.13.8-2.el5.i386.rpm
warning: sendmail-doc-8.13.8-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:sendmail-doc ########################################### [100%]
[root@dns Server]#
[root@dns Server]# rpm -qa | grep sendmail
sendmail-devel-8.13.8-2.el5
sendmail-doc-8.13.8-2.el5
sendmail-cf-8.13.8-2.el5
sendmail-8.13.8-2.el5
[root@dns Server]# rpm -qa | grep m4
m4-1.4.5-3.el5.1
clip_p_w_picpath033
clip_p_w_picpath034
2 、修改 vim /etc/mail/sendmail.mc
116将smtp侦听范围从127.0.0.1改为0.0.0.0
clip_p_w_picpath036
155行修改成自己域: LOCAL_DOMAIN(`benet.com')dnl
clip_p_w_picpath038
3 使用 m4 命令生成 sendmail.cf 文件
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
4 、修改local-host-names 文件添加域名及主机名
vim /etc/mail/local-host-names
[root@dns Server]# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
[root@dns Server]# vim /etc/mail/local-host-names
# local-host-names - include all aliases for your machine here.
benet.com.
mail.benet.com.
~
~
~
"/etc/mail/local-host-names" 3L, 91C 已写入
[root@dns Server]#
clip_p_w_picpath040
5 、安装Dovecot 软件包(POP3 和IMAP
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
perl(DBI) is needed by mysql-5.0.45-7.el5.i386
[root@dns Server]# rpm -ivh --aid perl-DBI-1.52-2.el5.i386.rpm
warning: perl-DBI-1.52-2.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:perl-DBI ########################################### [100%]
[root@dns Server]# rpm -ivh --aid mysql-5.0.45-7.el5.i386.rpm
warning: mysql-5.0.45-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:mysql ########################################### [100%]
[root@dns Server]# rpm -ivh --aid dovecot-1.0.7-7.el5.i386.rpm
warning: dovecot-1.0.7-7.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing... ########################################### [100%]
1:dovecot ########################################### [100%]
6、启动sendmail和dovecot服务
[root@dns Server]# service sendmail restart
关闭 sm-client: [确定]
关闭 sendmail: [确定]
启动 sendmail: [确定]
启动 sm-client: [确定]
[root@dns Server]# service dovecot restart
停止 Dovecot Imap: [确定]
启动 Dovecot Imap: [确定]
[root@dns Server]#
clip_p_w_picpath042
7 、查看端口netstat
[root@dns Server]# netstat -ntl
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:2208 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:688 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.200:53 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:53 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:25 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:953 0.0.0.0:* LISTEN
tcp 0 0 127.0.0.1:2207 0.0.0.0:* LISTEN
tcp 0 0 :::993 :::* LISTEN
tcp 0 0 :::995 :::* LISTEN
tcp 0 0 :::110 LISTEN
tcp 0 0 :::143 :::* LISTEN
tcp 0 0 :::22 :::* LISTEN
tcp 0 0 ::1:953 :::* LISTEN
[root@dns Server]# netstat -an | grep 25
tcp 0 0 0.0.0.0:25 0.0.0.0:* LISTEN
udp 0 0 0.0.0.0:52546 0.0.0.0:*
unix 2 [ ] DGRAM 8925
[root@dns Server]# netstat -an | grep 110
tcp 0 0 :::110 LISTEN
[root@dns Server]# netstat -an | grep 143
tcp 0 0 :::143 :::* LISTEN
unix 2 [ ] STREAM CONNECTED 10143 /var/run/setrans/.setrans-unix
clip_p_w_picpath044
8 、验证Sendmail 的SMTP 认证功能telnet localhost 25
[root@dns Server]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 dns.benet.com ESMTP Sendmail 8.13.8/8.13.8; Sat, 10 Oct 2009 22:15:28 +0800
ehlo localhost
250-dns.benet.com Hello localhost.localdomain [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 dns.benet.com closing connection
Connection closed by foreign host.
[root@dns Server]# telnet localhost 110
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
+OK Dovecot ready.
quit
+OK Logging out
Connection closed by foreign host.
[root@dns Server]#
clip_p_w_picpath046
telnet mail.benet.com 25
clip_p_w_picpath048
telnet mail.benet.com 110
clip_p_w_picpath050
9 、建立用户
[root@dns Server]# useradd zhangsan
[root@dns Server]# passwd zhangsan
Changing password for user zhangsan.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]# useradd lisi
[root@dns Server]# passwd lisi
Changing password for user lisi.
New UNIX password:
BAD PASSWORD: it is based on a dictionary word
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
[root@dns Server]#
10 、客户端测试
clip_p_w_picpath052
clip_p_w_picpath054
clip_p_w_picpath056
clip_p_w_picpath058
clip_p_w_picpath060
clip_p_w_picpath062
clip_p_w_picpath063
clip_p_w_picpath065
clip_p_w_picpath067
clip_p_w_picpath069
 
配置文件在附件里面:
如有不懂的地方,请call我!qq:357714938 mail:hongwish8es@126.com