diff --git a/postfix/tasks/main.yml b/postfix/tasks/main.yml index fad51faae41af8e3fc035d6b98e7f8673ac30be2..b50ddd8c75c75dfe6b0b4d93ccbf354fccc791e1 100644 --- a/postfix/tasks/main.yml +++ b/postfix/tasks/main.yml @@ -6,6 +6,7 @@ - postfix - postfix-pcre - postfix-cdb + - memcached tags: - postfix - mail @@ -24,9 +25,10 @@ - mail - name: ensure templated config is present - template: src=templates/{{ item }} dest=/etc/postfix/main.cf + template: src=templates/{{ item }}.j2 dest=/etc/postfix/{{ item }} with_items: - - main.cf.j2 + - main.cf + - postscreen_cache notify: - restart postfix tags: diff --git a/postfix/templates/main.cf.j2 b/postfix/templates/main.cf.j2 index a3e599582c5ef93e9922949fb59a978a3c35a133..f21ff9fdf74838b97555b2894d226eaa5497ca5d 100644 --- a/postfix/templates/main.cf.j2 +++ b/postfix/templates/main.cf.j2 @@ -115,3 +115,5 @@ postscreen_bare_newline_enable = yes # default: postscreen_bare_newline_action = ignore postscreen_bare_newline_action = drop # +postscreen_cache_map = memcache:/etc/postfix/postscreen_cache +proxy_write_maps = proxy:btree:/var/lib/postfix/postscreen_cache diff --git a/postfix/templates/postscreen_cache.j2 b/postfix/templates/postscreen_cache.j2 new file mode 100644 index 0000000000000000000000000000000000000000..0a886f89523234675fe08ae9b4ff057f4125c824 --- /dev/null +++ b/postfix/templates/postscreen_cache.j2 @@ -0,0 +1,12 @@ +# Django : 2014-11-07 postscreen-cache Konfigurationsdatei +# # +# + +{% for partner in groups['mail'] %} + {% if partner != ansible_hostname %} +memcache = inet::{{hostvars[partner]["tinc_vpnip"]}}11211 + {% endif %} +{% endfor %} + +backup = proxy:btree:/var/lib/postfix/postscreen_cache +key_format = postscreen:%s