summaryrefslogtreecommitdiff
path: root/ansible/roles/mail-server/tasks/dovecot.yml
blob: 1780397fe722b4f2cce696e705d0ba24282ed84f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
- name: add user pienirelay
  user:
    name: pienirelay
    comment: E-mail relay
    password: "{{ lookup('pipe', 'pass show pieni.net/pienirelay | mkpasswd -m SHA-512 -s') }}"

- name: install dovecot
  apt:
    name: dovecot-imapd

- name: configure dovecot for ssl
  copy:
    src: dovecot-ssl.conf
    dest: /etc/dovecot/conf.d/11-ssl.conf
  notify: restart dovecot

- name: install dovecot "service auth" config
  copy:
    src: dovecot-master.conf
    dest: /etc/dovecot/conf.d/11-master.conf
  notify: restart dovecot

- name: set max connections per user+IP
  lineinfile:
    path: /etc/dovecot/conf.d/20-imap.conf
    regexp: mail_max_userip_connections
    line: "mail_max_userip_connections = 20"
  notify: restart dovecot