/etc/postfix/master.cf 中未定义的参数

bil*_*oah 5 postfix 18.04

全新安装的 Ubuntu 18 中的默认 master.cf 文件似乎包含一些未定义的参数:

submission块和smtps块下:

  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
Run Code Online (Sandbox Code Playgroud)

这里发生了什么?这是一个错误吗?还是包维护者希望我们自己定义这些?

昨天当我在安装新软件包时收到这些警告时,我想到了这一点:

postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_sender_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_client_restrictions
postconf: warning: /etc/postfix/master.cf: undefined parameter: mua_helo_restrictions
Run Code Online (Sandbox Code Playgroud)

小智 6

您可以通过在 postfix 的 main.cf 文件中添加以下内容来消除错误消息:

smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions

mua_client_restrictions = permit_sasl_authenticated, reject

mua_sender_restrictions = permit_sasl_authenticated, reject

mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
Run Code Online (Sandbox Code Playgroud)

保存 main.cf 和后缀重新加载,然后后缀检查。你应该看到没有打印。这就是我为从构建中删除错误所做的工作。这似乎是构建遗留下来的默认值。我相信,你可以发表评论的3线出在master.cf,然后就可以使用smtpd_client_restrictions, smtpd_sender_restrictionssmtpd_recipient_restrictions以及smtpd_helo_restrictions在main.cf的后缀。