设为首页 收藏本站
查看: 1018|回复: 0

[经验分享] sendmail.mc配置文件的解释

[复制链接]

尚未签到

发表于 2015-11-25 11:02:19 | 显示全部楼层 |阅读模式
原文:http://www.linuxsir.org/bbs/showthread.php?t=179390

我在书(Redhat Linux 9 宝典)上看到一篇sendmail.mc的注释文档,觉得挺好的就摘录了下来,与大家分享。希望对大家有帮助。当然不对的和不足的地方,请大家改正。

Sendmail.mc文件的最前面几行完成一些辅助工作,
divert(-1)dnl
在生成配置文件时删除额外的输出。
dnl #
dnl # This is the sendmail macro config file for m4. If you make changes to
dnl # /etc/mail/sendmail.mc, you will need to regenerate the
dnl # /etc/mail/sendmail.cf file by confirming that the sendmail-cf package is
dnl # installed and then performing a
dnl #
dnl #     make -C /etc/mail
dnl #
include(`/usr/share/sendmail-cf/m4/cf.m4')dnl
将sendmail所需的规则包含进来。
VERSIONID(`setup for Red Hat Linux')dnl
指出配置文件是针对Red Hat Linux,(可以任意值)
OSTYPE(`linux')dnl
必须设置为linux以获得sendmail所需文件的正确位置。
dnl #
dnl # Uncomment and edit the following line if your outgoing mail needs to
dnl # be sent out through an external mail server:
dnl #
dnl define(`SMART_HOST',`smtp.your.provider')
指定邮件服务器中继。
dnl #
define(`confDEF_USER_ID',``8:12'')dnl
指定以mail用户(UID:8)和mail组(GID:12)的身份运行守护进程。
Define(`confTRUSTED_USER`,`SMMSP`) dnl
将smmsp添加到sendmail的可信用户列表中,其他的可信用户是root,uucp,daemon(smmsp用户被赋予部分sendmail假脱机目录和邮件数据库文件的所有权。
dnl define(`confAUTO_REBUILD')dnl
如果有必要,sendmail将自动重建别名数据库。
define(`confTO_CONNECT', `1m')dnl
将sendmail等待初始连接完成的时间设置为1分钟(1m)
define(`confTRY_NULL_MX_LIST',true)dnl
设为true,如果接收服务器是一台主机最佳的MX,试着直接连接那台主机。
define(`confDONT_PROBE_INTERFACES',true)dnl
设为true,sendmai守护进程将不会把本地网络接口插入到已知等效地址列表中。
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')dnl
设置分发接收邮件的程序(默认是procmail)。
define(`ALIAS_FILE', `/etc/aliases')dnl
设置分发接收邮件的邮件别名数据库。
dnl define(`STATUS_FILE', `/etc/mail/statistics')dnl
设置分发接收邮件的邮件统计文件的位置。
define(`UUCP_MAILER_MAX', `2000000')dnl
设置UUCP邮件程序接收的最大信息(以字节计)
define(`confUSERDB_SPEC', `/etc/mail/userdb.db')dnl
设置用户数据库(在该数据库中可替换特定用户的默认邮件服务器)的位置。
define(`confPRIVACY_FLAGS', `authwarnings,novrfy,noexpn,restrictqrun')dnl
强制sendmail使用某种邮件协议,例如,authwarnings表明使用X- Authentication-Warning 标题,并记录在日志文件中;novrfy和noexpn设置防止请求相应的服务,restrictqrun选项禁止sendmail使用-q选项
define(`confAUTH_OPTIONS', `A')dnl
设置由于SMTP验证
dnl #
dnl # The following allows relaying if the user authenticates, and disallows
dnl # plaintext authentication (PLAIN/LOGIN) on non-TLS links
dnl #
dnl define(`confAUTH_OPTIONS', `A p')dnl  使用明文登入。
dnl #
dnl # PLAIN is the preferred plaintext authentication method and used by
dnl # Mozilla Mail and Evolution, though Outlook Express and other MUAs do
dnl # use LOGIN. Other mechanisms should be used if the connection is not
dnl # guaranteed secure.
dnl #
dnl TRUST_AUTH_MECH(`EXTERNAL DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
dnl define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
允许sendmail使用明文口令以外的其他验证机制。
dnl #
dnl # Rudimentary information on creating certificates for sendmail TLS:
dnl #     make -C /usr/share/ssl/certs usage
dnl #
dnl define(`confCACERT_PATH',`/usr/share/ssl/certs')
dnl define(`confCACERT',`/usr/share/ssl/certs/ca-bundle.crt')
dnl define(`confSERVER_CERT',`/usr/share/ssl/certs/sendmail.pem')
dnl define(`confSERVER_KEY',`/usr/share/ssl/certs/sendmail.pem')
以上四行启用证书。
dnl #
dnl # This allows sendmail to use a keyfile that is shared with OpenLDAP's
dnl # slapd, which requires the file to be readble by group ldap
dnl #
dnl define(`confDONT_BLAME_SENDMAIL',`groupreadablekeyfile')dnl
如果密钥文件需要被除sendmail外的其他应用程序读取,那么显示以上行。
dnl #
dnl define(`confTO_QUEUEWARN', `4h')dnl
设置邮件发送被延期多久之后向发送人发送通知消息,默认为4小时。
dnl define(`confTO_QUEUERETURN', `5d')dnl
设置多长时间返回一个无法发送消息。
dnl define(`confQUEUE_LA', `12')dnl
dnl define(`confREFUSE_LA', `18')dnl
以上二行分别设置排队或拒绝的接收邮件的系统负载平均水平。
define(`confTO_IDENT', `0')dnl
设置等待接收IDENT查询响应的超时值(默认为0,永不超时)

FEATURE宏用于设置一些特殊的sendmail特性。
dnl FEATURE(delay_checks)dnl
FEATURE(`no_default_msa',`dnl')dnl
FEATURE(`smrsh',`/usr/sbin/smrsh')dnl
Smrsh定义/usr/sbin/smrsh 作为sendmail用来接受命令的简单shell。
FEATURE(`mailertable',`hash -o /etc/mail/mailertable.db')dnl
设置mailertable数据库位置
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable.db')dnl
设置`virtusertable数据库位置
FEATURE(redirect)dnl
允许拒绝接收已移走的用户的邮件并提供其新地址。
FEATURE(always_add_domain)dnl
always_add_domain使得在所有发送的邮件上为主机名添加本地域名。
FEATURE(use_cw_file)dnl
表明sendmail使用/etc/mail/local-host-names文件为该邮件服务器提供另外得主机名
FEATURE(use_ct_file)dnl
表明sendmail使用/etc/mail/trusted-users文件提供可信用户名(可信用户可用另一个用户名发送邮件而不会收到警告消息)。
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)及其选项($h:hostname,$u:user name).
FEATURE(`access_db',`hash -T<TMPF> -o /etc/mail/access.db')dnl
设置访问数据库得位置,该数据库指出允许哪些主机通过此服务器中继邮件。
FEATURE(`blacklist_recipients')dnl
启用该服务器为所选用户、主机或地址阻塞接收邮件的功能。(access_db和blacklist_recipients特性对防止垃圾邮件有用)。
EXPOSED_USER(`root')dnl
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 #
dnl # DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
允许接受本地主机创建的邮件,如果要允许接收从Internet或其他网络接口(如局域网)传入的邮件,一定要注释掉此行。
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 # NOTE: binding both IPv4 and IPv6 daemon to the same port requires
dnl #       a kernel patch
dnl #
dnl DAEMON_OPTIONS(`port=smtp,Addr=::1, Name=MTA-v6, Family=inet6')dnl
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 #
FEATURE(`accept_unresolvable_domains')dnl
启用accept_unresolvable_domains,使得能够接收域名不可解析的主机发送来的邮件。如果有需要使用邮件服务器的客户机(如拨号计算机),启用该选项。关闭该选项有助于防止垃圾邮件。
dnl #
dnl FEATURE(`relay_based_on_MX')dnl
dnl #
dnl # Also accept email sent to &quot;localhost.localdomain&quot; as local email.
dnl #
LOCAL_DOMAIN(`localhost.localdomain')dnl
使域名`localhost.localdomain作为本地计算机名被接受
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
MAILER(procmail)dnl

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-143340-1-1.html 上篇帖子: Linux系统sendmail启动速度慢的解决办法 下篇帖子: 【转】Linux系统sendmail启动速度慢的解决办法
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表