Browse Source

Merge pull request #141 from cji/master

Fixes issue #8
Luke Cyca 10 years ago
parent
commit
7ac1954020

+ 5
- 0
roles/mailserver/files/etc_postfix_maps_smtp_header_checks.pcre View File

1
+/^\s*(Received: from)[^\n]*(.*)/ REPLACE $1 [127.0.0.1] (localhost [127.0.0.1])$2
2
+/^\s*User-Agent/        IGNORE
3
+/^\s*X-Enigmail/        IGNORE
4
+/^\s*X-Mailer/          IGNORE
5
+/^\s*X-Originating-IP/  IGNORE

+ 9
- 0
roles/mailserver/tasks/postfix.yml View File

8
     - postgresql-9.1
8
     - postgresql-9.1
9
     - postfix-pgsql
9
     - postfix-pgsql
10
     - python-psycopg2
10
     - python-psycopg2
11
+    - postfix-pcre
11
 
12
 
12
 - name: Set postgres password
13
 - name: Set postgres password
13
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"
14
   command: sudo -u {{ db_admin_username }} psql -d {{ db_admin_username }} -c "ALTER USER postgres with  password '{{ db_admin_password }}';"
25
   template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
26
   template: src=mailserver.sql.j2 dest=/etc/postfix/import.sql owner=root group=root mode=0600
26
   notify: import sql postfix
27
   notify: import sql postfix
27
 
28
 
29
+- name: Create postfix maps directory
30
+  file: path=/etc/postfix/maps state=directory owner=root group=root
31
+  when: mail_header_privacy == 1
32
+
33
+- name: Copy smtp_header_checks.pcre
34
+  copy: src=etc_postfix_maps_smtp_header_checks.pcre dest=/etc/postfix/maps/smtp_header_checks.pcre owner=root group=root
35
+  when: mail_header_privacy == 1
36
+
28
 - name: Copy main.cf
37
 - name: Copy main.cf
29
   template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
38
   template: src=etc_postfix_main.cf.j2 dest=/etc/postfix/main.cf owner=root group=root
30
   notify: restart postfix
39
   notify: restart postfix

+ 5
- 0
roles/mailserver/templates/etc_postfix_main.cf.j2 View File

110
 postscreen_dnsbl_threshold = 3
110
 postscreen_dnsbl_threshold = 3
111
 postscreen_dnsbl_action = enforce
111
 postscreen_dnsbl_action = enforce
112
 postscreen_greet_action = enforce
112
 postscreen_greet_action = enforce
113
+
114
+{% if mail_header_privacy == 1 %}
115
+# Remove local client IP from headers
116
+smtp_header_checks = pcre:/etc/postfix/maps/smtp_header_checks.pcre
117
+{% endif %}

+ 1
- 0
vars/testing.yml View File

41
   - source: "webmaster@{{ domain }}"
41
   - source: "webmaster@{{ domain }}"
42
     destination: "{{ admin_email }}"
42
     destination: "{{ admin_email }}"
43
     domain_pk_id: 1
43
     domain_pk_id: 1
44
+mail_header_privacy: 1
44
 
45
 
45
 # z-push
46
 # z-push
46
 zpush_timezone: "America/New_York"  #Example: "America/New_York"
47
 zpush_timezone: "America/New_York"  #Example: "America/New_York"

+ 1
- 0
vars/user.yml View File

46
   - source: "webmaster@{{ domain }}"
46
   - source: "webmaster@{{ domain }}"
47
     destination: "{{ admin_email }}"
47
     destination: "{{ admin_email }}"
48
     domain_pk_id: 1
48
     domain_pk_id: 1
49
+mail_header_privacy: 1
49
 
50
 
50
 # z-push
51
 # z-push
51
 zpush_timezone: "TODO"  #Example: "America/New_York"
52
 zpush_timezone: "TODO"  #Example: "America/New_York"

Loading…
Cancel
Save