2019-09-08 14:23:01 -03:00

46 lines
1.6 KiB
YAML

---
- name: restart postfix
docker_container:
name: "{{ postfix_container}}"
state: started
restart: yes
- name: reload postfix
command: docker exec {{ postfix_container }} postfix reload
- name: newaliases
command: docker exec {{ postfix_container }} newaliases
- name: postmap hash aliases
command: >-
docker exec {{ postfix_container }} postmap
hash:{{ postfix_mail_domains[item].alias_lookup.file | default(
'/etc/postfix/'+item+'_aliases') }}
when:
- postfix_mail_domains[item].alias_lookup.provider|default(postfix_lookup_provider) == 'file'
loop: "{{ postfix_mail_domains.keys()|list }}"
- name: postmap hash users
command: >-
docker exec {{ postfix_container }} postmap
hash:{{ postfix_mail_domains[item]..user_lookup.file | default(
'/etc/postfix/'+item+'_users') }}
when:
- postfix_mail_domains[item].user_lookup.provider|default(postfix_lookup_provider) == 'file'
loop: "{{ postfix_mail_domains.keys()|list }}"
- name: postmap no reply aliases
command: >-
docker exec {{ postfix_container }} postmap
hash:{{ postfix_mail_domains[item].noreply_file | default(
'/etc/postfix/'+item+'_noreply') }}
loop: "{{ postfix_mail_domains.keys()|list }}"
- name: postmap access lists
command: docker exec {{ postfix_container }} postmap {{ item }}
loop:
- "/etc/postfix/{{ postfix_rules_dir }}/client_access_list"
- "/etc/postfix/{{ postfix_rules_dir }}/helo_access_list"
- "/etc/postfix/{{ postfix_rules_dir }}/recipient_access_list"
- "/etc/postfix/{{ postfix_rules_dir }}/sender_access_list"