AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 952776
Accepted
kittygirl
kittygirl
Asked: 2019-02-08 04:08:39 +0800 CST2019-02-08 04:08:39 +0800 CST 2019-02-08 04:08:39 +0800 CST

当`postconf -n`时警告`未定义参数:mua_sender_restrictions`

  • 772

我的系统是 centos 7。我正在根据这篇文章设置带有 postfix、dovecot、mariadb 的邮件服务器。
我的邮件服务器有问题,可以发送邮件但不能接收邮件。

然后我postconf -n,结果如下:

[root@server6328 log]# postconf -n
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
postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps
alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
broken_sasl_auth_clients = yes
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
data_directory = /var/lib/postfix
debug_peer_level = 2
debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5
disable_vrfy_command = yes
dovecot_destination_recipient_limit = 1
html_directory = no
inet_interfaces = all
inet_protocols = ipv4
mail_owner = postfix
mailq_path = /usr/bin/mailq.postfix
manpage_directory = /usr/share/man
message_size_limit = 30720000
milter_default_action = accept
milter_protocol = 6
mydestination = $myhostname,localhost.$mydomain,localhost,localhost.localdomain
myhostname = mail.mydomain.com
mynetworks = 127.0.0.1
newaliases_path = /usr/bin/newaliases.postfix
non_smtpd_milters = $smtpd_milters
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps $virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains $relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps $recipient_canonical_maps $relocated_maps $transport_maps $mynetworks $virtual_mailbox_limit_maps
queue_directory = /var/spool/postfix
readme_directory = /usr/share/doc/postfix-2.10.1/README_FILES
sample_directory = /usr/share/doc/postfix-2.10.1/samples
sendmail_path = /usr/sbin/sendmail.postfix
setgid_group = postdrop
show_user_unknown_table_name = no
smtp_tls_security_level = may
smtpd_helo_required = yes
smtpd_helo_restrictions = reject_non_fqdn_helo_hostname,reject_invalid_helo_hostname,reject_unknown_helo_hostname
smtpd_milters = inet:127.0.0.1:8891
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination,check_policy_service unix:private/policy-spf,reject_invalid_hostname,reject_non_fqdn_helo_hostname,reject_non_fqdn_sender,reject_non_fqdn_recipient
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_path = private/auth
smtpd_sasl_security_options = noanonymous, noplaintext
smtpd_sasl_tls_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sender_restrictions = reject_non_fqdn_sender,reject_unknown_sender_domain,reject_rbl_client zen.spamhaus.org
smtpd_tls_auth_only = yes
smtpd_tls_cert_file = /etc/pki/dovecot/certs/fullchain.cer
smtpd_tls_key_file = /etc/pki/dovecot/private/*.mydomain.com.key
smtpd_tls_loglevel = 0
smtpd_tls_security_level = may
smtpd_use_tls = yes
unknown_local_recipient_reject_code = 550
virtual_alias_domains =
virtual_alias_maps = proxy:mysql:/etc/postfix/mysql-virtual_forwardings.cf, mysql:/etc/postfix/mysql-virtual_email2email.cf
virtual_gid_maps = static:1000
virtual_mailbox_base = /home/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/mysql-virtual_domains.cf
virtual_mailbox_limit = 209715200
virtual_mailbox_maps = proxy:mysql:/etc/postfix/mysql-virtual_mailboxes.cf
virtual_transport = dovecot
virtual_uid_maps = static:1000
postconf: warning: /etc/postfix/main.cf: unused parameter: policy_time_limit=3600s
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_limit_message=Sorry, the maildir has overdrawn diskspace quota
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: policy-spf_time_limit=3600

我注意到一些警告:

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
postconf: warning: /etc/postfix/main.cf: undefined parameter: virtual_mailbox_limit_maps

postconf: warning: /etc/postfix/main.cf: unused parameter: policy_time_limit=3600s
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_limit_message=Sorry, the maildir has overdrawn diskspace quota
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_maildir_extended=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: virtual_create_maildirsize=yes
postconf: warning: /etc/postfix/main.cf: unused parameter: policy-spf_time_limit=3600

的有效部分/etc/postfix/master.cf是:

smtp      inet  n       -       n       -       -       smtpd
#smtp      inet  n       -       n       -       1       postscreen
#smtpd     pass  -       -       n       -       -       smtpd
#dnsblog   unix  -       -       n       -       0       dnsblog
#tlsproxy  unix  -       -       n       -       0       tlsproxy
submission inet n       -       n       -       -       smtpd
  -o syslog_name=postfix/submission
  -o smtpd_tls_security_level=encrypt
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
 -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
smtps     inet  n       -       n       -       -       smtpd
  -o syslog_name=postfix/smtps
  -o smtpd_tls_wrappermode=yes
  -o smtpd_sasl_auth_enable=yes
  -o smtpd_reject_unlisted_recipient=no
  -o smtpd_client_restrictions=$mua_client_restrictions
  -o smtpd_helo_restrictions=$mua_helo_restrictions
  -o smtpd_sender_restrictions=$mua_sender_restrictions
  -o smtpd_recipient_restrictions=permit_sasl_authenticated,reject
  -o milter_macro_daemon_name=ORIGINATING
#628       inet  n       -       n       -       -       qmqpd
pickup    unix  n       -       n       60      1       pickup
cleanup   unix  n       -       n       -       0       cleanup
qmgr      unix  n       -       n       300     1       qmgr
#qmgr     unix  n       -       n       300     1       oqmgr
tlsmgr    unix  -       -       n       1000?   1       tlsmgr

dovecot   unix  -       n       n       -       -       pipe
  flags=DRhu user=vmail:vmail argv=/usr/libexec/dovecot/dovecot-lda -f ${sender} -d ${recipient}
policyd-spf  unix  -       n       n       -       0       spawn
  user=nobody argv=/usr/libexec/postfix/policyd-spf

这些警告的可能原因是什么?如何解决?

postfix
  • 4 4 个回答
  • 12859 Views

4 个回答

  • Voted
  1. John Greene
    2020-01-02T11:11:08+08:002020-01-02T11:11:08+08:00

    让我猜猜,你正在运行最新的 Postfix。是的,后缀的后缀维护者添加了mua_client_restrictions配置文件的on ...以部分方式。

    “错误”是在https://github.com/vdukhovni/postfix/commit/99ff75430d5c908879caffc1125680ed68019021#diff-6f25157451e1bcb001a0a6926795486bR23中引入的

    您可以向Postfix 维护者Victor写一行,以对Postfix 提供的默认文件进行部分介绍。虽然 Victor 确实是专注于更安全的 Postfix 及其安全性的专家,但 Victor 还没有赶上 GitHub 文化,更不用说为 Postfix 维护 bugzilla,而是依赖于其他发行版特定的 bugzilla。

    或者您可以使用此StackExchange 答案自行修复。

    更新:或者我可以剪切粘贴答案......

    将以下内容添加到您的 /etc/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
    
    • 14
  2. Best Answer
    anx
    2019-02-11T05:22:40+08:002019-02-11T05:22:40+08:00

    你的main.cf和master.cf配置不匹配。这很可能是由于复制了原本应该放在一起但缺少一侧的配置示例。

    1. 当您在 master.cf 中更改 policyd-spf 的设置时,您调用了您的服务

      policyd-spf  unix  -       n       n       -       0       spawn
      

      但是然后在main.cf您尝试在没有d字母的情况下更改其配置:

      policy-spf_time_limit=3600
      
    2. 然后你对smtpd_*_restrictions. 您指的是mua_*设置,但没有在任何地方定义这些设置。

      如果您将自定义限制列表添加到,则可以在限制设置右侧使用它们时smtpd_restriction_classes跳过,这样可以在配置错误的情况下为您提供更易读的错误消息:$

      smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, 
                                  mua_helo_restrictions, mua_sender_restrictions
      mua_client_restrictions = permit_sasl_authenticated, reject
      ...
      

      然后在master.cf:

      smtps ..
        ..
        -o smtpd_client_restrictions=mua_client_restrictions
      

    我强烈建议从一组新的库存配置开始,并逐步只添加您真正需要的那些更改。

    运行 postconf 应该发出零警告。避免运行postconf已经告诉您配置的某些部分不起作用的系统。即使在postfix中包含许多保护措施,也很容易创建一个会被垃圾邮件发送者滥用的设置。

    • 5
  3. Marjorie R
    2020-04-13T08:46:00+08:002020-04-13T08:46:00+08:00

    我认为从语法上讲,您需要使用 -o 前缀编写这些行:

         -o smtpd_restriction_classes = mua_sender_restrictions, mua_client_restrictions, mua_helo_restrictions
         -o mua_client_restrictions = permit_sasl_authenticated, reject
         -o mua_sender_restrictions = permit_sasl_authenticated, reject
         -o mua_helo_restrictions = permit_mynetworks, reject_non_fqdn_hostname, reject_invalid_hostname, permit
    

    至少这对我有用。

    • 1
  4. Mike Conigliaro
    2021-04-15T16:04:29+08:002021-04-15T16:04:29+08:00

    鉴于这些mua_选项甚至无效(请参阅 参考资料man 5 postconf),我认为您可以删除这些行。这对我有用。

    • 0

相关问题

  • Postfix 在特定端口上接受邮件

  • 让 Postfix 以两种方式处理垃圾邮件

  • Postfix 或 exim:自动/程序化和转发电子邮件设置

  • 后缀电子邮件地址

  • 什么是最好的开源电子邮件解决方案包

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve