Browse Source

redirect mail to sympa

mail
Andrea Cimbalo 8 years ago
parent
commit
eef2b43ff4
3 changed files with 26 additions and 3 deletions
  1. +1
    -0
      mail.yaml
  2. +2
    -2
      roles/dovecot/tasks/main.yaml
  3. +23
    -1
      roles/postfix/tasks/main.yaml

+ 1
- 0
mail.yaml View File

@ -8,6 +8,7 @@
- role: postfix
ldap_server: "{{ hostvars['ldap'].ansible_host }}"
fqdn_domain: "lilik.it"
lists_server: "{{ hostvars['lists'].ansible_host }}"
- role: dovecot
fqdn_domain: "lilik.it"
ldap_server: "{{ hostvars['ldap'].ansible_host }}"

+ 2
- 2
roles/dovecot/tasks/main.yaml View File

@ -35,7 +35,7 @@
- blockinfile:
dest: /etc/dovecot/conf.d/10-master.conf
insertafter: 'inet_listener imaps {'
marker: '#ANSIBLE BLOCK FOR IMAPS PORT'
marker: '#{mark} ANSIBLE BLOCK FOR IMAPS PORT'
block: |
port = 993
ssl = yes
@ -44,7 +44,7 @@
- blockinfile:
dest: "/etc/dovecot/conf.d/10-master.conf"
insertafter: "unix_listener auth-userdb {"
marker: '#ANSIBLE BLOCK FOR AUTH USER'
marker: '#{mark} ANSIBLE BLOCK FOR AUTH USER'
block: |
group = postman
mode = 0664


+ 23
- 1
roles/postfix/tasks/main.yaml View File

@ -47,5 +47,27 @@
- lineinfile: dest=/etc/postfix/main.cf line="virtual_mailbox_maps = proxy:ldap:/etc/postfix/ldap-accounts.cf"
notify: restart postfix
- lineinfile: dest=/etc/postfix/main.cf line="mydestination = mail.lilik.it, lists.lilik.it, localhost" regexp='mydestination =' state=present
- lineinfile: dest=/etc/postfix/main.cf line="mydestination = mail.lilik.it, localhost" regexp='mydestination =' state=present
notify: restart postfix
- name: edit postfix mynetworks
lineinfile: dest=/etc/postfix/main.cf line="mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 10.0.0.0/16" regexp='mynetworks =' state=present
notify: restart postfix
- name: create transport map
lineinfile: dest=/etc/postfix/transport line="lists.lilik.it :[{{ lists_server }}]" regexp="lists.lilik.it" create=yes
register: postfix_transport_result
notify: restart postfix
- name: ensure transport map is compiled
shell: postmap /etc/postfix/transport
notify: reload postfix
when: postfix_transport_result | changed
- name: enable transport map
lineinfile: dest=/etc/postfix/main.cf line="transport_maps = hash:/etc/postfix/transport" regexp='transport_maps =' state=present
notify: restart postfix
- name: add lists.lilik.it relay
lineinfile: dest=/etc/postfix/main.cf line="relay_domains = lists.lilik.it" regexp='relay_domains =' state=present
notify: restart postfix

Loading…
Cancel
Save