一:防火墙上的Sendmail配置:
我们采用Redhat Linux 6.1 加 Sendmail 8.9.3作为操作环境:
安装操作系统和防火墙的配置略,建议采用3c905b或者Intel pro100 的网卡,先配置DNS。
设置/etc/named.conf象这样:
============
zone "."{
type hint;
file "named.ca";
};
zone "0.0.127.in-addr.arpa"{
notify no;
type master;
file "127.0.0";
};
zone "11.168.192.in-addr.arpa"{
notify no;
type master;
file "192.168.11";
};
zone "domain.com" {
notify no;
type master;
file "domain.com";
};
文件 domain.com象下面这样:
@ IN SOA dns.domain.com. root.mail.domain.com. (
1999120401 86400 3600 3600000 86400 )
NS dns.domain.com.
A a.b.c.d
MX 10 mail.domain.com.
firewall A a.b.c.d
mail A a.b.c.d
dns A a.b.c.d
加下面的行到/etc/hosts
192.168.11.1 mail.domain.com mail
192.168.11.5 firewall.domain.com firewall
============
下面配置Sendmail,首先要先创建一个用来生成/etc/sendmail.cf的sendmail.mc文件,
在Redhat 安装的过程中有一个默认地redhat.mc在/usr/lib/sendmail-cf/cf目录下。
我们修改为如下:
===========
divert(-1)
dnl This is the macro config file used to generate the /etc/sendmail.cf
dnl file. If you modify thei file you will have to regenerate the
dnl /etc/sendmail.cf by running this macro config through the m4
dnl preprocessor:
dnl
dnl m4 /etc/sendmail.mc > /etc/sendmail.cf
dnl
dnl You will need to have the sendmail-cf package installed for this to
dnl work.
include(`../m4/cf.m4')
define(`confDEF_USER_ID',``8:12'')
OSTYPE(`linux')
undefine(`UUCP_RELAY')
undefine(`BITNET_RELAY')
define(`confAUTO_REBUILD')
define(`confTO_CONNECT', `1m')
define(`confTRY_NULL_MX_LIST',true)
define(`confDONT_PROBE_INTERFACES',true)
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
define(`ALIAS_FILE',`/etc/mail/aliases')
FEATURE(`smrsh',`/usr/sbin/smrsh')
FEATURE(`mailertable',`hash -o /etc/mail/mailertable')
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')
FEATURE(`domaintable',`hash -o /etc/mail/domaintable')
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
MAILER(procmail)
MAILER(smtp)
FEATURE(`access_db')
FEATURE(`blacklist_recipients')
dnl We strongly recommend to comment this one out if you want to protect
dnl yourself from spam. However, the laptop and users on computers that do
dnl not hav 24x7 DNS do need this.
dnl FEATURE(`accept_unresolvable_domains')
dnl FEATURE(`relay_based_on_MX')
=============
然后用m4 redhat.mc > sendmail.cf生成sendmail.cf放到/etc目录下。且做如下操作: