2017-10-10 00:03:22 +02:00
|
|
|
- name: ensure packages are installed
|
|
|
|
apt:
|
2019-12-31 15:25:10 +01:00
|
|
|
name:
|
|
|
|
- dovecot-ldap
|
|
|
|
- dovecot-imapd
|
|
|
|
- dovecot-pop3d
|
|
|
|
- dovecot-sieve
|
|
|
|
- dovecot-managesieved
|
2017-10-10 00:03:22 +02:00
|
|
|
state: present
|
2017-10-10 17:25:50 +02:00
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
2022-01-25 10:10:11 +01:00
|
|
|
- name: Generate 4096 bits Diffie-Hellman parameters (may take several minutes)
|
2021-09-21 14:46:41 +02:00
|
|
|
openssl_dhparam:
|
|
|
|
path: /etc/ssl/dhparams.pem
|
2022-01-25 10:10:11 +01:00
|
|
|
size: 4096
|
2021-08-25 11:48:10 +02:00
|
|
|
|
2017-10-13 12:44:37 +02:00
|
|
|
- name: disable pam auth
|
|
|
|
replace:
|
|
|
|
dest: /etc/dovecot/conf.d/10-auth.conf
|
|
|
|
regexp: "[^#]!include auth-system.conf.ext"
|
|
|
|
replace: "#!include auth-system.conf.ext"
|
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
2017-10-10 17:25:50 +02:00
|
|
|
- name: update ldap auth
|
|
|
|
lineinfile:
|
|
|
|
dest: /etc/dovecot/dovecot-ldap.conf.ext
|
|
|
|
line: "{{ item.key }} = {{ item.value }}"
|
|
|
|
regexp: "^#*{{ item.key }}"
|
|
|
|
state: present
|
2021-05-04 14:18:40 +02:00
|
|
|
loop:
|
2019-12-31 15:25:10 +01:00
|
|
|
- { key: 'hosts', value: '127.0.0.1' }
|
|
|
|
- { key: 'auth_bind', value: 'yes' }
|
|
|
|
- { key: 'ldap_version', value: 3 }
|
|
|
|
- { key: 'base', value: "{{ ldap_suffix }}" }
|
|
|
|
- { key: 'user_attrs', value: 'homeDirectory=home' }
|
|
|
|
- { key: 'user_filter', value: '(&(isActive=TRUE)(uid=%u))' }
|
|
|
|
- { key: 'pass_attrs', value: 'uid=user,userPassword=password' }
|
2017-10-10 17:25:50 +02:00
|
|
|
when: ldap_suffix is defined
|
|
|
|
notify: reload dovecot
|
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
|
|
|
- name: create vmail group
|
|
|
|
group:
|
|
|
|
name: vmail
|
2020-12-07 17:26:45 +01:00
|
|
|
gid: "{{ dovecot_vmail_gid }}"
|
2020-12-17 08:05:16 +01:00
|
|
|
system: True
|
2017-10-10 17:25:50 +02:00
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
|
|
|
- name: create vmail user
|
|
|
|
user:
|
|
|
|
name: vmail
|
|
|
|
group: vmail
|
2020-12-07 17:26:45 +01:00
|
|
|
uid: "{{ dovecot_vmail_uid }}"
|
2017-10-10 17:25:50 +02:00
|
|
|
shell: /bin/false
|
2020-12-17 08:05:16 +01:00
|
|
|
system: True
|
2017-10-10 17:25:50 +02:00
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
|
|
|
- name: deploy evolix config
|
|
|
|
template:
|
|
|
|
src: z-evolinux-defaults.conf.j2
|
|
|
|
dest: /etc/dovecot/conf.d/z-evolinux-defaults.conf
|
|
|
|
mode: "0644"
|
|
|
|
notify: reload dovecot
|
|
|
|
tags:
|
|
|
|
- dovecot
|
2017-10-10 00:03:22 +02:00
|
|
|
|
2022-02-24 10:42:48 +01:00
|
|
|
- name: deploy file for custom configuration
|
|
|
|
template:
|
|
|
|
src: zzz-evolinux-custom.conf.j2
|
|
|
|
dest: /etc/dovecot/conf.d/zzz-evolinux-custom.conf
|
|
|
|
mode: "0644"
|
|
|
|
notify: reload dovecot
|
|
|
|
tags:
|
|
|
|
- dovecot
|
|
|
|
|
2017-10-10 00:03:22 +02:00
|
|
|
- include: munin.yml
|
2017-10-10 17:25:50 +02:00
|
|
|
tags:
|
|
|
|
- dovecot
|
2022-03-02 09:51:59 +01:00
|
|
|
|
2022-03-02 11:07:14 +01:00
|
|
|
- name: log2mail is installed
|
|
|
|
apt:
|
|
|
|
name: log2mail
|
|
|
|
state: present
|
|
|
|
tags: dovecot
|
2023-01-06 09:54:51 +01:00
|
|
|
|
2022-03-02 11:07:14 +01:00
|
|
|
- name: dovecot is configured in log2mail
|
|
|
|
blockinfile:
|
|
|
|
path: /etc/log2mail/config/mail.conf
|
|
|
|
create: true
|
|
|
|
owner: log2mail
|
|
|
|
group: adm
|
|
|
|
mode: "0640"
|
|
|
|
block: |
|
|
|
|
file = /var/log/mail.log
|
|
|
|
pattern = "Out of memory"
|
|
|
|
mailto = {{ log2mail_alert_email or general_alert_email | mandatory }}
|
|
|
|
template = /etc/log2mail/mail
|
|
|
|
notify: restart log2mail
|
|
|
|
tags: dovecot
|
|
|
|
|