Skip to content

Commit 042db5b

Browse files
committed
dovecot with dovecot-deliver
1 parent 2bd9b1b commit 042db5b

1 file changed

Lines changed: 44 additions & 24 deletions

File tree

roles/postfix/tasks/main.yaml

Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -17,41 +17,61 @@
1717
install_recommends: false
1818
with_items:
1919
- postfix
20-
# - postfix-ldap
20+
- postfix-ldap
2121
- dovecot-ldap
2222
- dovecot-imapd
2323
- rsyslog
24-
- dovecot-lmtpd
24+
# - dovecot-lmtpd
2525
# - amavisd-new
2626
# - postgrey #TODO
2727
# - spamassassin
2828
# - clamav-daemon
2929

30-
#- name: upload ldap-aliases.cf
31-
# template:
32-
# src: ldap-aliases.cf.j2
33-
# dest: "/etc/postfix/ldap-aliases.cf"
34-
# notify: restart_postfix
35-
#- lineinfile: dest=/etc/postfix/main.cf line="virtual_alias_maps = proxy:ldap:/etc/postfix/ldap-aliases.cf"
36-
# notify: restart_postfix
30+
- name: upload ldap-aliases.cf
31+
template:
32+
src: ldap-aliases.cf.j2
33+
dest: "/etc/postfix/ldap-aliases.cf"
34+
notify: restart_postfix
35+
- lineinfile: dest=/etc/postfix/main.cf line="virtual_alias_maps = proxy:ldap:/etc/postfix/ldap-aliases.cf"
36+
notify: restart_postfix
3737

38-
#- name: upload ldap-domains.cf
39-
# template:
40-
# src: ldap-domains.cf.j2
41-
# dest: "/etc/postfix/ldap-domains.cf"
42-
# notify: restart_postfix
43-
#- lineinfile: dest=/etc/postfix/main.cf line="virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap-domains.cf"
44-
# notify: restart_postfix
38+
- name: upload ldap-domains.cf
39+
template:
40+
src: ldap-domains.cf.j2
41+
dest: "/etc/postfix/ldap-domains.cf"
42+
notify: restart_postfix
43+
- lineinfile: dest=/etc/postfix/main.cf line="virtual_mailbox_domains = proxy:ldap:/etc/postfix/ldap-domains.cf"
44+
notify: restart_postfix
4545

46-
#- name: upload ldap-accounts.cf
47-
# template:
48-
# src: ldap-accounts.cf.j2
49-
# dest: "/etc/postfix/ldap-accounts.cf"
50-
# notify: restart_postfix
51-
#- lineinfile: dest=/etc/postfix/main.cf line="virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap-accounts.cf"
52-
# notify: restart_postfix
46+
- name: upload ldap-accounts.cf
47+
template:
48+
src: ldap-accounts.cf.j2
49+
dest: "/etc/postfix/ldap-accounts.cf"
50+
notify: restart_postfix
51+
- lineinfile: dest=/etc/postfix/main.cf line="virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap-accounts.cf"
52+
notify: restart_postfix
53+
54+
#TODO remove previous mydestination definition
55+
- lineinfile: dest=/etc/postfix/main.cf line="mydestination = mail.lilik.it, lists.lilik.it, localhost" state=present
56+
notify: restart_postfix
57+
58+
- blockinfile:
59+
dest: "/etc/dovecot/conf.d/10-master.conf"
60+
insertafter: "unix_listener auth-userdb {"
61+
content: |
62+
group = postman
63+
mode = 0664
64+
user = postman
65+
notify: restart_postfix
66+
67+
- lineinfile: dest=/etc/postfix/main.cf line="virtual_transport = dovecot" state=present
68+
notify: restart_postfix
5369

54-
- lineinfile: dest=/etc/postfix/main.cf line="virtual_transport = lmtp:unix:private/dovecot-lmtp" state=present
70+
- blockinfile:
71+
dest: /etc/postfix/master.cf
72+
block: |
73+
dovecot unix - n n - - pipe
74+
flags=DRhu user=postman:postman argv=/usr/lib/dovecot/deliver -d ${recipient} -f ${sender}
5575
notify: restart_postfix
5676

5777
- name: create postman group

0 commit comments

Comments
 (0)