Skip to content

Commit 26c2842

Browse files
committed
postfix: simplified headers-check (privacy)
1 parent fb71a35 commit 26c2842

File tree

4 files changed

+6
-8
lines changed

4 files changed

+6
-8
lines changed

roles/postfix/tasks/install/config.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22

3-
- name: Copy configuration template
3+
- name: Copy configuration templates
44
notify: Restart postfix
55
ansible.builtin.template:
66
src: "{{ file }}"
@@ -14,3 +14,4 @@
1414
- headers-check.cf
1515
loop_control:
1616
loop_var: file
17+
tags: config

roles/postfix/tasks/install/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- name: Generic config
1818
ansible.builtin.include_tasks: install/config.yml
19+
tags: config
1920

2021
- name: Firewall configuration
2122
ansible.builtin.include_tasks: install/firewall.yml

roles/postfix/templates/headers-check.cf

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,4 @@
99
{% endif %}
1010
# Remove client's IP address
1111
/^X-Originating-IP:/ IGNORE
12-
# Remove links that contains LAN details
13-
/^Received: from [a-z]+\.{{ network.domain | regex_escape() }}.*/ IGNORE
14-
/^Received: from.*\[192\.168\.[0-9]+\.[0-9]+\].*/ IGNORE
15-
/^Received: from.*\[172\.16\.[0-9]+\.[0-9]+\].*/ IGNORE
16-
/^Received: from.*\[10\.[0-9]+.[0-9]+\.[0-9]+\].*/ IGNORE
12+
/^Received: .*/ IGNORE

roles/postfix/templates/main.cf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,8 @@ non_smtpd_milters =
132132
# antispam:
133133
# antivirus:
134134

135-
# Special filters on the headers
136-
header_checks = pcre:/etc/postfix/headers-check.cf
135+
# Special filters on the headers when sending emails outside
136+
smtp_header_checks = pcre:/etc/postfix/headers-check.cf
137137

138138
# The macros that are sent to Milter applications after the SMTP MAIL FROM command.
139139
milter_mail_macros = i {mail_addr} {client_addr} {client_name} {auth_authen} {auth_type}

0 commit comments

Comments
 (0)