Postfix header_checks 被忽略

Postfix header_checks 被忽略

我使用的是 Ubuntu 20.04。很久以前,我安装了 Postfix (v3.4.13) 和 Dovecot (v2.3.7.2)。现在,我想使用 header_checks 覆盖 Message-Id 标头。这是我第一次尝试使用此功能,因此之前没有测试过。问题是 Postfix 似乎忽略了这些规则。

其中/etc/postfix/header_checks只有一行:/Message-Id:\s+<(.*?)@default.tld>/ REPLACE Message-Id: <[email protected]>

一开始我以为我可能拼写错误了,但命令返回了正确的响应。之后我检查了配置文件。postmap -q "Message-Id: <[email protected]>" regexp:/etc/postfix/header_checksmain.cf包含设置header_checks = pcre:/etc/postfix/header_checks,所以看起来没问题。邮件日志也不包含有关此问题的任何信息。

在网上搜索时(包括本论坛和 Postfix 文档),我发现了一些有关receive_override_options=no_header_body_checks可能阻止header_checks信息,但似乎receive_override_options甚至没有设置。

这里是 postconf -n 的输出(一些私有值被覆盖(Hidden)):

alias_database = hash:/etc/aliases
alias_maps = hash:/etc/aliases
append_dot_mydomain = no
biff = no
compatibility_level = 2
header_checks = pcre:/etc/postfix/header_checks
inet_interfaces = all
inet_protocols = all
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
mailbox_transport = lmtp:unix:private/dovecot-lmtp
milter_default_action = accept
milter_protocol = 6
mydestination = $myhostname, localhost.$mydomain, localhost
myhostname = (Hidden)
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
myorigin = /etc/mailname
non_smtpd_milters = $smtpd_milters
policyd-spf_time_limit = 3600
readme_directory = no
recipient_delimiter = +
relayhost =
smtp_tls_CApath = /etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
smtpd_milters = local:opendkim/opendkim.sock
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_policy_service unix:private/policyd-spf
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
smtpd_tls_cert_file = /etc/letsencrypt/live/(Hidden)/fullchain.pem
smtpd_tls_key_file = /etc/letsencrypt/live/(Hidden)/privkey.pem
smtpd_tls_security_level = may
smtputf8_enable = no
virtual_alias_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_catchall_maps.cf
virtual_gid_maps = static:2000
virtual_mailbox_base = /var/vmail
virtual_mailbox_domains = proxy:mysql:/etc/postfix/sql/mysql_virtual_domains_maps.cf
virtual_mailbox_maps = proxy:mysql:/etc/postfix/sql/mysql_virtual_mailbox_maps.cf, proxy:mysql:/etc/postfix/sql/mysql_virtual_alias_domain_mailbox_maps.cf
virtual_minimum_uid = 2000
virtual_transport = lmtp:unix:private/dovecot-lmtp
virtual_uid_maps = static:2000

答案1

您正在检查postmap查找类型regexp,但您的配置中有查找类型pcre。这些是不同的字典类型。检查您是否已pcre启用postconf -m

相关内容