From 07916f2a896c6c28a0c9e38f2cc67a6dfe062c46 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 4 Oct 2015 16:33:57 +0200 Subject: [PATCH] Adding vmail user/group. Setting Dovecot auth config. --- group_vars/all | 2 ++ ispmail.yml | 1 + roles/ispmail-dovecot/handlers/main.yml | 4 ++++ roles/ispmail-dovecot/tasks/main.yml | 14 ++++++++++++++ 4 files changed, 21 insertions(+) create mode 100644 roles/ispmail-dovecot/handlers/main.yml create mode 100644 roles/ispmail-dovecot/tasks/main.yml diff --git a/group_vars/all b/group_vars/all index 5426ba4..140870a 100644 --- a/group_vars/all +++ b/group_vars/all @@ -1,2 +1,4 @@ ispmail_mysql_mailuser_password: fLxsWdf5ABLqwhZr +ispmail_dovecot_auth_mechanisms: plain login + diff --git a/ispmail.yml b/ispmail.yml index 1ed295e..587a6a1 100644 --- a/ispmail.yml +++ b/ispmail.yml @@ -7,4 +7,5 @@ - ispmail-certificate - ispmail-database - ispmail-postfix + - ispmail-dovecot diff --git a/roles/ispmail-dovecot/handlers/main.yml b/roles/ispmail-dovecot/handlers/main.yml new file mode 100644 index 0000000..afba075 --- /dev/null +++ b/roles/ispmail-dovecot/handlers/main.yml @@ -0,0 +1,4 @@ +--- +- name: restart dovecot + service: name=dovecot state=restarted + diff --git a/roles/ispmail-dovecot/tasks/main.yml b/roles/ispmail-dovecot/tasks/main.yml new file mode 100644 index 0000000..26b6114 --- /dev/null +++ b/roles/ispmail-dovecot/tasks/main.yml @@ -0,0 +1,14 @@ +--- +- name: Create the vmail group + group: name=vmail gid=5000 +- name: Create the vmail user + user: name=vmail uid=5000 group=vmail +- name: Create mailbox directory + file: path=/var/vmail state=directory owner=vmail group=vmail +- name: Allow LOGIN authentication method for Outlook clients + lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^auth_mechanisms =' line='auth_mechanisms = {{ispmail_dovecot_auth_mechanisms}}' backrefs=yes +- name: Disabling system authentication + lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^!include auth-system.conf.ext' line='#!include auth-system.conf.ext' backrefs=yes +- name: Enabling SQL-based authentication + lineinfile: dest=/etc/dovecot/conf.d/10-auth.conf regexp='^\#!include auth-sql.conf.ext' line='!include auth-sql.conf.ext' backrefs=yes +