dovecot: Finish up dovecot install

This commit is contained in:
Timo Makinen 2021-03-11 05:27:42 +00:00
parent 25417ed9eb
commit 532e47b36c
2 changed files with 43 additions and 13 deletions

View file

@ -28,18 +28,53 @@
with_first_found: with_first_found:
- "/srv/letsencrypt/live/{{ mail_server }}/fullchain.pem" - "/srv/letsencrypt/live/{{ mail_server }}/fullchain.pem"
- "/srv/ca/certs/{{ inventory_hostname }}.crt" - "/srv/ca/certs/{{ inventory_hostname }}.crt"
tages: certificates tags: certificates
notify: restart dovecot notify: restart dovecot
- name: create local config - name: create local config
template: template:
dest: /etc/dovecot/conf.d/99local.conf dest: /etc/dovecot/conf.d/99-local.conf
src: local.conf.j2 src: local.conf.j2
mode: 0644 mode: 0644
owner: root owner: root
group: "{{ ansible_wheel }}" group: "{{ ansible_wheel }}"
validate: doveconf -n %s
notify: restart dovecot notify: restart dovecot
- name: fix selinux contexts from cache directory
sefcontext:
path: "/var/spool/dovecot/index/home(/.*)?"
setype: user_home_t
- name: create cache directory hierarcy
file:
path: "{{ item }}"
state: directory
mode: 0755
owner: root
group: "{{ ansible_wheel }}"
setype: _default
with_items:
- /var/spool/dovecot
- /var/spool/dovecot/index
- name: create user cache directory
file:
path: /var/spool/dovecot/index/home
state: directory
mode: 1777
owner: root
group: "{{ ansible_wheel }}"
setype: _default
- name: create tmpfs mount for cache
mount:
state: mounted
path: /var/spool/dovecot/index/home
src: none
fstype: tmpfs
opts: context="system_u:object_r:user_home_t:s0"
- name: enable service - name: enable service
service: service:
name: dovecot name: dovecot

View file

@ -1,13 +1,16 @@
# ssl settings # ssl settings
ssl = required ssl = required
ssl_cert = {{ tls_certs }}/{{ mail_server }}.crt ssl_cert = <{{ tls_certs }}/{{ mail_server }}.crt
ssl_key = {{ tls_private }}/{{ mail_server }}.key ssl_key = <{{ tls_private }}/{{ mail_server }}.key
# kerberos # kerberos
auth_gssapi_hostname = "$ALL" auth_gssapi_hostname = "$ALL"
auth_krb5_keytab = /etc/dovecot/dovecot.keytab auth_krb5_keytab = /etc/dovecot/dovecot.keytab
auth_mechanisms = gssapi plain login auth_mechanisms = gssapi plain login
# enable only imap
protocols = imap
# use index from tmpfs # use index from tmpfs
mail_location = mbox:~/imapmail/:INBOX=/var/mail/%u:INDEX=/var/spool/dovecot/index/home/%u mail_location = mbox:~/imapmail/:INBOX=/var/mail/%u:INDEX=/var/spool/dovecot/index/home/%u
@ -32,15 +35,7 @@ protocol imap {
imap_idle_notify_interval = 29 mins imap_idle_notify_interval = 29 mins
} }
# disable plain text imap and pop3 # disable plain text imap
service pop3-login {
inet_listener pop3 {
port = 0
}
inet_listener pop3s {
port = 0
}
}
service imap-login { service imap-login {
inet_listener imap { inet_listener imap {
port = 0 port = 0