sendmail所需包只需两个:
# rpm -qa |grep sendmail
sendmail-8.13.8-2.el5
sendmail-cf-8.13.8-2.el5 安装sendmail做smtp SERVER
步骤一:Sendmail前先做DNS 配置 定义主域名
这一步是配置DNS服务器
# cat /etc/named.conf
zone "mydomain.com" IN {
type master;
file "mydomain.zone";
allow-update { none; };
};
vi /var/named/mydomain.zone
$TTL 86400
@ IN SOA @ root (
42 ; serial (d. adams)
3H ; refresh
15M ; retry
1W ; expiry
1D );
@ IN NS 192.168.0.12;
IN A 192.168.0.12;
www IN A 192.168.0.12;
test IN A 192.168.0.12;
ftp IN A 192.168.0.12;
pop3 IN A 192.168.0.12;
smtp IN A 192.168.0.1 步骤二:sendmail.cf修改
使本地和异地foxmail都能发mail
必须改成实际域名,否则虽然 linux本地能发mail,但一些客户端(如foxmail)无法通过sendmail发mail
C{w}localhost localdomain
改成
C{w}localhost mydomain.com smtp.mydomain.com
主域名 email(smtp)服务器域名
=========================================
# SMTP client options
#O ClientPortOptions=Family=inet, Address=0.0.0.0
client address不必改,就保持缺省的#
=========================================
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA
Addr只能是0.0.0.0
步骤三:linux smtp服务启动
# /etc/init.d/sendmail restart
Shutting down sendmail: [ OK ]
Shutting down sm-client: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ] sendmail daemon启动同时也启动了client
# cat local-host-names
====================================
# local-host-names - include all aliases for your machine here
# cat trusted-users
====================================
# trusted-users - users that can send mail as others without a warning
# apache, mailman, majordomo, uucp, are good candidates
# cat access
====================================
# Check the /usr/share/doc/sendmail/README.cf file for a description
# of the format of this file. (search for access_db in that file)
# The /usr/share/doc/sendmail/README.cf is part of the sendmail-doc
# package.
#
# by default we allow relaying from localhost...
localhost.localdomain RELAY
localhost RELAY
127.0.0.1 RELAY
192.168.0 RELAY