1 - name: install postfix
2 apt: name=postfix,bsd-mailx state=latest
3 - name: install postfix-mysql
4 when: postfix.vmail_mysql_password is defined
5 apt: name=postfix-mysql state=latest
7 service: name=postfix enabled=yes
9 - name: install postfix config
11 dest: /etc/postfix/{{ item }}
12 src: templates/{{ item }}
17 - name: install postfix mysql config
18 when: postfix.vmail_mysql_password is defined
20 dest: /etc/postfix/{{ item }}
21 src: templates/{{ item }}
25 - mysql_vmail_aliases.cf
26 - mysql_vmail_senders.cf
27 - mysql_vmail_users.cf
29 - name: create empty maps
30 when: postfix.virtual_mailbox_domains is defined
32 dest: /etc/postfix/{{ item }}
38 - name: give postfix user access to opendkim
39 # we assume the user alredy exists (it is created above by installing postfix)
40 when: postfix.opendkim is defined
47 - name: delete old local-mail cronjob
48 file: path=/etc/cron.daily/local-mail state=absent
49 - name: install check-for-local-mail cronjob
51 dest: /etc/cron.daily/check-for-local-mail
52 src: files/check-for-local-mail
54 - name: install mailman-check cronjob
55 when: postfix.mailman is defined and postfix.mailman
57 dest: /etc/cron.daily/mailman-check
58 src: files/mailman-check
60 - name: remove mailman-check cronjob
61 when: not (postfix.mailman is defined and postfix.mailman)
63 path: /etc/cron.daily/mailman-check
67 - name: create newmail dir
68 file: path=/root/newmail state=directory
69 - name: install newmail script
71 dest: /root/newmail/newmail
72 src: files/newmail/newmail
74 - name: install newmail templates
76 dest: /root/newmail/templates.py
77 src: files/newmail/templates.py
78 when: postfix.vmail_mysql_password is defined