diff options
Diffstat (limited to 'roles/IMAP/tasks')
| -rw-r--r-- | roles/IMAP/tasks/main.yml | 1 | ||||
| -rw-r--r-- | roles/IMAP/tasks/mda.yml | 36 | 
2 files changed, 37 insertions, 0 deletions
| diff --git a/roles/IMAP/tasks/main.yml b/roles/IMAP/tasks/main.yml index d71573e..df21dd2 100644 --- a/roles/IMAP/tasks/main.yml +++ b/roles/IMAP/tasks/main.yml @@ -1,2 +1,3 @@  ---  - include: imap.yml   tags=imap,dovecot +- include: mda.yml    tags=mda,mail,postfix diff --git a/roles/IMAP/tasks/mda.yml b/roles/IMAP/tasks/mda.yml new file mode 100644 index 0000000..39938fd --- /dev/null +++ b/roles/IMAP/tasks/mda.yml @@ -0,0 +1,36 @@ +- name: Install Postfix +  apt: pkg={{ item }} +  with_items: +    - postfix +    - postfix-ldap + +- name: Configure Postfix +  template: src=etc/postfix/main.cf.j2 +            dest=/etc/postfix-{{ postfix_instance[inst].name }}/main.cf +            owner=root group=root +            mode=0644 +  register: r +  notify: +    - Restart Postfix + +- name: Create directory /etc/postfix-.../virtual +  file: path=/etc/postfix-{{ postfix_instance[inst].name }}/virtual +        owner=root group=root +        state=directory +        mode=0755 + +- name: Copy lookups tables +  copy: src=etc/postfix/virtual/{{ item }} +        dest=/etc/postfix-{{ postfix_instance[inst].name }}/virtual/{{ item }} +        owner=root group=root +        mode=0644 +  with_items: +    - mailbox_domains.cf +    - mailbox_maps.cf +    - transport_content_filter_maps.cf + +- name: Start Postfix +  service: name=postfix state=started +  when: not r.changed + +- meta: flush_handlers | 
