Sendmail 配置文件(二)

运维 系统运维
Sendmail是最重要的邮件传输代理程序。也是在Unix环境下使用最广泛的实现邮件发送/接受的邮件传输代理程序。本文就带大家看看Sendmail的配置文件。

Sendmail 配置文件如下:

  FEATURE(`no_default_msa',`dnl')dnl (允许MSA被DAMEMON_OPTION覆盖的默认设置)

  FEATURE(`smrsh',`/usr/sbin/smrsh')dnl (设置邮件发送器smrsh的存放路径)

  FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl (设置邮件发送器数据库的存放路径)

  FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl (设置虚拟邮件域数据库的存放路径)

  FEATURE(redirect)dnl (支持.redirect虚拟域)

  FEATURE(always_add_domain)dnl (增加主机名到所有本地发送的邮件)

  FEATURE(use_cw_file)dnl (装载/etc/mail/local-host-names文件中定义的主机名)

  FEATURE(use_ct_file)dnl (装载可信任用户名单)

  dnl #

  dnl # The following limits the number of processes sendmail can fork to accept

  dnl # incoming messages or process its message queues to 12.) sendmail refuses

  dnl # to accept connections once it has reached its quota of child processes.

  dnl #

  dnl define(`confMAX_DAEMON_CHILDREN', 12)dnl

  dnl #

  dnl # Limits the number of new connections per second. This caps the overhead

  dnl # incurred due to forking new sendmail processes. May be useful against

  dnl # DoS attacks or barrages of spam. (As mentioned below, a per-IP address

  dnl # limit would be useful but is not available as an option at this writing.)

  dnl #

  dnl define(`confCONNECTION_RATE_THROTTLE', 3)dnl

  dnl #

  dnl # The -t option will retry delivery if e.g. the user runs over his quota.

  dnl #

  FEATURE(local_procmail,`',`procmail -t -Y -a $h -d $u')dnl (使用procmail作为本地邮件发送者)

  FEATURE(`access_db',`hash -T -o /etc/mail/access.db')dnl (从/etc/mail/access.db装载可以中继的域)

  FEATURE(`blacklist_recipients')dnl (根据访问数据库的值过滤外来邮件)

  EXPOSED_USER(`root')dnl (禁止伪装发送者地址中出现root用户)

  dnl #

  dnl # The following causes sendmail to only listen on the IPv4 loopback address

  dnl # 127.0.0.1 and not on any other network devices. Remove the loopback

  dnl # address restriction to accept email from the internet or intranet.

  dnl #

  DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl (指定sendmail作为MTA运行时的参数)

  dnl #

  dnl # The following causes sendmail to additionally listen to port 587 for

  dnl # mail from MUAs that authenticate. Roaming users who can't reach their

  dnl # preferred sendmail daemon due to port 25 being blocked or redirected find

  dnl # this useful.

  dnl #

  dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

  dnl #

  dnl # The following causes sendmail to additionally listen to port 465, but

  dnl # starting immediately in TLS mode upon connecting. Port 25 or 587 followed

  dnl # by STARTTLS is preferred, but roaming clients using Outlook Express can't

  dnl # do STARTTLS on ports other than 25. Mozilla Mail can ONLY use STARTTLS

  dnl # and doesn't support the deprecated smtps; Evolution <1.1.1 uses smtps

  dnl # when SSL is enabled-- STARTTLS support is available in version 1.1.1.

  dnl #

  dnl # For this to work your OpenSSL certificates must be configured.

  dnl #

  dnl DAEMON_OPTIONS(`Port=smtps, Name=TLSMTA, M=s')dnl

  dnl #

  dnl # The following causes sendmail to additionally listen on the IPv6 loopback

  dnl # device. Remove the loopback address restriction listen to the network.

  dnl #

  dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl

  dnl #

  dnl # enable both ipv6 and ipv4 in sendmail:

  dnl #

  dnl DAEMON_OPTIONS(`Name=MTA-v4, Family=inet, Name=MTA-v6, Family=inet6')

  dnl #

  dnl # We strongly recommend not accepting unresolvable domains if you want to

  dnl # protect yourself from spam. However, the laptop and users on computers

  dnl # that do not have 24x7 DNS do need this.

  dnl #

#p#

  FEATURE(`accept_unresolvable_domains')dnl 设置可以接受不能由NDS主机所发送的邮件

  dnl #

  dnl FEATURE(`relay_based_on_MX')dnl

  dnl #

  dnl # Also accept email sent to "localhost.localdomain" as local email.

  dnl #

  LOCAL_DOMAIN(`localhost.localdomain')dnl 设置本地域

  dnl #

  dnl # The following example makes mail from this host and any additional

  dnl # specified domains appear to be sent from mydomain.com

  dnl #

  dnl MASQUERADE_AS(`mydomain.com')dnl

  dnl #

  dnl # masquerade not just the headers, but the envelope as well

  dnl #

  dnl FEATURE(masquerade_envelope)dnl

  dnl #

  dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well

  dnl #

  dnl FEATURE(masquerade_entire_domain)dnl

  dnl #

  dnl MASQUERADE_DOMAIN(localhost)dnl

  dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl

  dnl MASQUERADE_DOMAIN(mydomainalias.com)dnl

  dnl MASQUERADE_DOMAIN(mydomain.lan)dnl

  MAILER(smtp)dnl (指定sendmail所有SMTP发送者,包括smtp,esmtp,smtp8,和replay)

  MAILER(procmail)dnl (指定使用procmail作为本地邮件的发送者)

看了上面的sendmail配置文件,怎么样,对你有帮助吧,快点跟朋友分享吧!

【编辑推荐】

责任编辑:赵鹏 来源: 网络转载
相关推荐

2011-01-21 15:08:45

Sendmail

2011-01-19 10:48:38

sendmail配置

2010-06-03 13:44:35

Sendmail配置

2011-01-19 14:00:21

2011-01-13 16:27:26

Linux配置文件

2011-01-21 09:32:57

LinuxSendmail

2010-12-28 16:35:32

Outlook 配置文

2010-12-27 14:59:31

Outlook 配置文

2011-01-21 15:40:56

Sendmail

2011-01-21 10:58:57

sendmail流程

2011-03-28 15:52:16

Nagios配置文件

2011-03-28 09:07:26

Nagios配置文件

2011-04-01 16:30:49

Nagios

2009-07-09 15:55:18

WebWork配置文件

2011-03-03 09:14:38

PureFTPd

2011-01-19 10:57:54

sendmail配置

2010-05-05 16:14:09

Unix管理

2010-08-05 14:36:07

NFS服务

2011-03-25 17:13:37

Nagios配置文件

2009-09-22 10:23:15

Hibernate配置
点赞
收藏

51CTO技术栈公众号