sendmail.mc配置文件的解释

2024-01-19 05:18

本文主要是介绍sendmail.mc配置文件的解释,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

原文: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 "localhost.localdomain" 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

这篇关于sendmail.mc配置文件的解释的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/621372

相关文章

springboot项目打jar制作成镜像并指定配置文件位置方式

《springboot项目打jar制作成镜像并指定配置文件位置方式》:本文主要介绍springboot项目打jar制作成镜像并指定配置文件位置方式,具有很好的参考价值,希望对大家有所帮助,如有错误... 目录一、上传jar到服务器二、编写dockerfile三、新建对应配置文件所存放的数据卷目录四、将配置文

Redis 配置文件使用建议redis.conf 从入门到实战

《Redis配置文件使用建议redis.conf从入门到实战》Redis配置方式包括配置文件、命令行参数、运行时CONFIG命令,支持动态修改参数及持久化,常用项涉及端口、绑定、内存策略等,版本8... 目录一、Redis.conf 是什么?二、命令行方式传参(适用于测试)三、运行时动态修改配置(不重启服务

nginx启动命令和默认配置文件的使用

《nginx启动命令和默认配置文件的使用》:本文主要介绍nginx启动命令和默认配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录常见命令nginx.conf配置文件location匹配规则图片服务器总结常见命令# 默认配置文件启动./nginx

SpringBoot实现多环境配置文件切换

《SpringBoot实现多环境配置文件切换》这篇文章主要为大家详细介绍了如何使用SpringBoot实现多环境配置文件切换功能,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录1. 示例代码结构2. pom文件3. application文件4. application-dev文

使用Nginx配置文件服务器方式

《使用Nginx配置文件服务器方式》:本文主要介绍使用Nginx配置文件服务器方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1. 为什么选择 Nginx 作为文件服务器?2. 环境准备3. 配置 Nginx 文件服务器4. 将文件放入服务器目录5. 启动 N

springboot实现配置文件关键信息加解密

《springboot实现配置文件关键信息加解密》在项目配置文件中常常会配置如数据库连接信息,redis连接信息等,连接密码明文配置在配置文件中会很不安全,所以本文就来聊聊如何使用springboot... 目录前言方案实践1、第一种方案2、第二种方案前言在项目配置文件中常常会配置如数据库连接信息、Red

SpringBoot中配置文件的加载顺序解读

《SpringBoot中配置文件的加载顺序解读》:本文主要介绍SpringBoot中配置文件的加载顺序,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录SpringBoot配置文件的加载顺序1、命令⾏参数2、Java系统属性3、操作系统环境变量5、项目【外部】的ap

Spring Boot读取配置文件的五种方式小结

《SpringBoot读取配置文件的五种方式小结》SpringBoot提供了灵活多样的方式来读取配置文件,这篇文章为大家介绍了5种常见的读取方式,文中的示例代码简洁易懂,大家可以根据自己的需要进... 目录1. 配置文件位置与加载顺序2. 读取配置文件的方式汇总方式一:使用 @Value 注解读取配置方式二

python3 gunicorn配置文件的用法解读

《python3gunicorn配置文件的用法解读》:本文主要介绍python3gunicorn配置文件的使用,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录python3 gunicorn配置文件配置文件服务启动、重启、关闭启动重启关闭总结python3 gun

Spring Boot 配置文件之类型、加载顺序与最佳实践记录

《SpringBoot配置文件之类型、加载顺序与最佳实践记录》SpringBoot的配置文件是灵活且强大的工具,通过合理的配置管理,可以让应用开发和部署更加高效,无论是简单的属性配置,还是复杂... 目录Spring Boot 配置文件详解一、Spring Boot 配置文件类型1.1 applicatio