diff --git a/handlers/main.yml b/handlers/main.yml index 965d8f7..da51a3f 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -5,4 +5,10 @@ - name: Restart postfix service: name: postfix - state: restarted \ No newline at end of file + state: restarted + +- name: Postmap whitelist + shell: /usr/sbin/postmap /etc/postfix/maps/whitelist_senders.map + +- name: Postmap blacklist + shell: /usr/sbin/postmap /etc/postfix/blacklist diff --git a/tasks/configure.yml b/tasks/configure.yml index 86996ae..334fd29 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -207,6 +207,16 @@ group: postfix mode: 0644 +- name: Ensure white list senders file exists + file: + state: touch + path: /etc/postfix/maps/whitelist_senders.map + owner: root + group: postfix + mode: 0644 + notify: Postmap whitelist + + - name: Create local aliases ansible.builtin.lineinfile: path: /etc/aliases @@ -260,6 +270,4 @@ backup: true create: true loop: "{{ postfix_blacklist }}" - -- name: Postmap blacklist - shell: /usr/sbin/postmap /etc/postfix/blacklist + notify: Postmap blacklist