I'm using Ubuntu 20.04. I installed Postfix (v3.4.13) with Dovecot (v2.3.7.2) a long time ago. Now, I want to overwrite the Message-Id header using header_checks. It's the first time I'm trying to use this feature, so it hasn't been tested before. The problem is that Postfix seems to be ignoring these rules.
In /etc/postfix/header_checks
there is only one line: /Message-Id:\s+<(.*?)@default.tld>/ REPLACE Message-Id: <[email protected]>
At first, I thought that I might have misspelled something, but the command postmap -q "Message-Id: <[email protected]>" regexp:/etc/postfix/header_checks
returns the correct response. After that, I checked the configuration files. main.cf
contains the setting header_checks = pcre:/etc/postfix/header_checks
, so it seems fine. The mail logs also don't contain any information about this issue.
While searching online (including this forum and the Postfix documentation), I came across some information about the receive_override_options=no_header_body_checks
rule that could potentially block the header_checks
, but it seems that receive_override_options
is not even set.
Here is the output of postconf -n (some private values are overwritten with (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