postfix mail.cf文件中的部分配置详解

// 31行 postfix 队列的主目录
queue_directory = /var/spool/postfix数据库

// 36行 postfix命令目录
command_directory = /usr/sbin服务器

// 42行 postfix 的各个服务器程序目录
daemon_directory = /usr/libexec/postfix网络

// 59行 以此参数指定的系统帐户,做为队列文件的拥有者以及postfix daemon 进程的运行身份
mail_owner = postfixdom

// 76行 完整主机名称(主机名称+网域名称)
myhostname = mail.youhost.compost

// 83行 邮件系统的网域名称
mydomain = youhost.com命令行

// 99行 附加到只含人名部分的,不完整邮件地址的网域名称
myorigin = $mydomainrest

// 116行 指定postfix系统监听的网络接口 此处必须是localhost或127.0.0.1或内网ip,若注释或填入公网ip  服务器的25端口将对公网开放,默认值为all 即监听全部网络接口,此项指定localhost后 本机postfix就只能发邮件不能接收邮件
inet_interfaces = localhost接口

// 119行 网络协议 ipv6在国内还不怎么普及 这里ipv4便可
inet_protocols = ipv4队列

// 163行 指定postfix接收邮件时收件人的域名,换句话说,也就是你的postfix系统要接收什么样的邮件。此项配置中$myhostname表示postfix接受@$myhostname为后缀的邮箱的邮件 逗号分割支持指多项。此项默认值使用myhostname
mydestination = $myhostname, localhost.$mydomain, localhost进程

// 210行 此项制定接收邮件的规则 能够是hash文件 此项对本次配置无心义 能够直接注释
local_recipient_maps =

// 266行 指定你所在的网络的网络地址 请依据实际状况修改
mynetworks = 127.0.0.1

// 387行 别名表,列出local mda 所使用的别名数据库
alias_maps = hash:/etc/postfix/aliases

// 398行 别名数据库(postalias/newaliases 命令生成)
alias_database = hash:/etc/postfix/aliases

// 420行 我的邮件库路径
home_mailbox = Maildir/

// 571行 指定MUA经过smtp链接postfix时返回的header头信息 原始配置附带有postfix版本号 去掉便可,此项酌情处理
smtpd_banner = youhost.com ESMTP Server

// 644行 供脚本或命令行用来寄送邮件
sendmail_path = /usr/sbin/sendmail.postfix命令目录

// 649行 兼容sendmail,用于重建别名数据库的newaliases程序路径
newaliases_path = /usr/bin/newaliases.postfix

// 660行 用来提交邮件或管理队列的组标识符
setgid_group = postdrop

// 668行 manpage 目录
manpage_directory = /usr/share/man

// 643行 样本配置文件目录
sample_directory = /etc/postfix

新增配置
// 指定postfix兼容MUA使用不规则的smtp协议--主要针对老版本的outlook  此项对于本次配置无心义
broken_sasl_auth_clients = yes

// 指定postfix使用sasl验证 通俗的将就是启用smtp并要求进行帐号、密码效验
smtpd_sasl_auth_enable = yes

// 指定能够向postfix发起SMTP链接的客户端的主机名或ip地址 此处permit_sasl_authenticated意思是容许经过sasl认证(也就是smtp连接时经过了帐号、密码效验的用户)的全部用户
smtpd_client_restrictions = permit_sasl_authenticated

// 发件人在执行RCPT TO命令时提供的地址进行限制规则  此处照搬复制便可
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination

// 指定SMTP认证的本地域名  本次配置能够使用 smtpd_sasl_local_domain = '' 或干脆注释掉 默认为空
smtpd_sasl_local_domain = $mydomain

// 取消smtp的匿名登陆  此项默认值为noanonymous smtp若能匿名登陆危害很是大 此项请务必指定为noanonymous
smtpd_sasl_security_options = noanonymous

// 指定经过postfix发送邮件的体积大小 此处表示5M message_size_limit = 5242880

相关文章
相关标签/搜索