1、软件包:
sendmail.i386<---邮件服务器端 MTA
sendmail-cf.i386<---邮件服务器的配置文件
sendmail-devel.i386<---邮件服务器端的开发包
sendmail-doc.i386<---帮助文档
m4.i386<---处理配置文件的工具
dovecot.i386<---pop邮件服务器端 MDA
procmail.i386<---负责把邮件分发到不同的用户邮箱(用户的邮件文件/var/mail/username)
2、配置Sendmail之前的准备
实验的环境:
sendmail服务器: 10.1.1.92
DNS服务器:10.1.1.67
a、设定好主机名字
hostname slave.upl.com
vim /etc/hosts
10.1.1.92 salve.upl.com
b、设定邮件服务器的/etc/resolv.conf
vim /etc/resolv.conf
nameserver 10.1.1.67
c、给DNS服务器添加MX记录
vim /var/named/chroot/var/named/data/master.upl.com.zone <---这是10.1.1.67 DNS服务器上的文件
IN MX 0 slave.upl.com.
slave IN A 10.1.1.92
[iyunv@slave mail]# telnet 127.0.0.1 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 slave.upl.com ESMTP Sendmail 8.13.8/8.13.8; Fri, 6 Nov 2009 10:18:45 +0800
helo slave.upl.com
250 slave.upl.com Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from:admin@google.com
250 2.1.0 admin@google.com... Sender ok <---寄信人的地址,随便写
rcpt to:tom@slave.upl.com<--收件人的地址
250 2.1.5 tom@slave.upl.com... Recipient ok
data<---输入邮件内容
354 Enter mail, end with "." on a line by itself
Good moning!
.<---结束内容输入
250 2.0.0 nA62IjUS003044 Message accepted for delivery
quit
221 2.0.0 slave.upl.com closing connection
Connection closed by foreign host.
发送邮件的命令还有:
mail -s "Just for test" mary@slave.upl.com < /etc/fstab
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart
2、验证:
使用 telnet测试验证功能:
[iyunv@dns mail_client]# telnet 10.1.1.92 25
Trying 10.1.1.92...
Connected to station92.cluster.com (10.1.1.92).
Escape character is '^]'.
220 slave.upl.com ESMTP Sendmail 8.13.8/8.13.8; Fri, 6 Nov 2009 14:38:12 +0800
helo sss
250 slave.upl.com Hello station20.cluster.com [10.1.1.20], pleased to meet you
mail from:gg@baidu.com
530 5.7.0 Authentication required
auth login
334 VXNlcm5hbWU6
dG9t
334 UGFzc3dvcmQ6
MTIz
235 2.0.0 OK Authenticated
mail from:gg@baidu.com
250 2.1.0 gg@baidu.com... Sender ok
rcpt to:bean@upl.com
250 2.1.5 bean@upl.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
sdfffffffffffffffffffffff
.
250 2.0.0 nA66cCGx006337 Message accepted for delivery
quit
别的一些用法
joe@upl.com error:nouser 550 No such user here
jax@upl.com error:5.7.0:550 Address invalid
=================================
第二、xinetd (扩展的网络服务守护进程)
作用:增强访问控制的功能,增强的日志记录功能
涉及的配置文件: /etc/xinetd.conf <---全局配置
例子1:把vsftp托管给xinetd
1、编辑配置文件
service ftp
{
socket_type = stream
protocol = tcp
wait = no <---no ,xinetd把接受到请求转发给vsftp之后,时候还继续监听
user = root <---运行服务的时候,进程的身份
server = /usr/sbin/vsftpd <---服务器的进程路径
disable = no <--- no ,启用这个托管设定
}
2、修给vsftpd的本身的配置文件
vim /etc/vsftpd/vsftpd.conf
listen=NO
3、重启服务并验证
service xinetd restart
验证
chkconfig --list
vsftp: 启用