From 2a2333cdfb016bb884887f46fbcbfdce6e064d74 Mon Sep 17 00:00:00 2001 From: Guilhem Moulin Date: Wed, 25 Jun 2014 02:37:48 +0200 Subject: Assume a DNS entry for each role. E.g., ldap.fripost.org, ntp.fripost.org, etc. (Ideally the DNS zone would be provisioned by ansible, too.) It's a bit unclear how to index the subdomains (mx{1,2,3}, etc), though. --- .../IMAP-proxy/files/etc/dovecot/conf.d/20-imapc.conf | 18 ++++++++++++++++++ .../files/etc/dovecot/conf.d/auth-imap.conf.ext | 17 +++++++++++++++++ roles/IMAP-proxy/tasks/main.yml | 16 +++------------- .../templates/etc/dovecot/conf.d/20-imapc.conf.j2 | 18 ------------------ .../templates/etc/dovecot/conf.d/auth-imap.conf.ext.j2 | 17 ----------------- 5 files changed, 38 insertions(+), 48 deletions(-) create mode 100644 roles/IMAP-proxy/files/etc/dovecot/conf.d/20-imapc.conf create mode 100644 roles/IMAP-proxy/files/etc/dovecot/conf.d/auth-imap.conf.ext delete mode 100644 roles/IMAP-proxy/templates/etc/dovecot/conf.d/20-imapc.conf.j2 delete mode 100644 roles/IMAP-proxy/templates/etc/dovecot/conf.d/auth-imap.conf.ext.j2 (limited to 'roles/IMAP-proxy') diff --git a/roles/IMAP-proxy/files/etc/dovecot/conf.d/20-imapc.conf b/roles/IMAP-proxy/files/etc/dovecot/conf.d/20-imapc.conf new file mode 100644 index 0000000..47785a4 --- /dev/null +++ b/roles/IMAP-proxy/files/etc/dovecot/conf.d/20-imapc.conf @@ -0,0 +1,18 @@ +# Smart IMAP proxying with imapc storage +# +# http://dovecot.org/pipermail/dovecot/2011-January/056975.html +# http://wiki2.dovecot.org/HowTo/ImapcProxy +# http://wiki2.dovecot.org/Migration/Dsync + +imapc_host = imap.fripost.org +imapc_port = 143 +imapc_user = %u + +# Read multiple mails in parallel, improves performance +mail_prefetch_count = 20 + +# The list of valid features can be found there +# http://hg.dovecot.org/dovecot-2.1/file/f572fbafb445/src/lib-storage/index/imapc/imapc-settings.c +# (in the struct 'imapc_feature_list imapc_feature_list') +imapc_features = rfc822.size + diff --git a/roles/IMAP-proxy/files/etc/dovecot/conf.d/auth-imap.conf.ext b/roles/IMAP-proxy/files/etc/dovecot/conf.d/auth-imap.conf.ext new file mode 100644 index 0000000..7478889 --- /dev/null +++ b/roles/IMAP-proxy/files/etc/dovecot/conf.d/auth-imap.conf.ext @@ -0,0 +1,17 @@ +# Authentication via remote IMAP server. Included from auth.conf. +# +# + +passdb { + driver = imap + args = host=imap.fripost.org port=143 + default_fields = userdb_imapc_user=%u userdb_imapc_password=%w +} + +# "prefetch" user database means that the passdb already provided the +# needed information and there's no need to do a separate userdb lookup. +# +userdb { + driver = prefetch + default_fields = home=/home/imapproxy/%d/%n +} diff --git a/roles/IMAP-proxy/tasks/main.yml b/roles/IMAP-proxy/tasks/main.yml index c630cfd..f76ee72 100644 --- a/roles/IMAP-proxy/tasks/main.yml +++ b/roles/IMAP-proxy/tasks/main.yml @@ -17,28 +17,18 @@ owner=imapproxy group=imapproxy mode=0700 -- name: Configure Dovecot (1) +- name: Configure Dovecot copy: src=etc/dovecot/conf.d/{{ item }} dest=/etc/dovecot/conf.d/{{ item }} owner=root group=root mode=0644 - register: r1 + register: r with_items: - 10-auth.conf - 10-logging.conf - 10-mail.conf - 10-master.conf - 15-mailboxes.conf - notify: - - Restart Dovecot - -- name: Configure Dovecot (2) - template: src=etc/dovecot/conf.d/{{ item }}.j2 - dest=/etc/dovecot/conf.d/{{ item }} - owner=root group=root - mode=0644 - register: r2 - with_items: - 20-imapc.conf - auth-imap.conf.ext notify: @@ -46,6 +36,6 @@ - name: Start Dovecot service: name=dovecot state=started - when: not (r1.changed or r2.changed) + when: not r.changed - meta: flush_handlers diff --git a/roles/IMAP-proxy/templates/etc/dovecot/conf.d/20-imapc.conf.j2 b/roles/IMAP-proxy/templates/etc/dovecot/conf.d/20-imapc.conf.j2 deleted file mode 100644 index a6b70c6..0000000 --- a/roles/IMAP-proxy/templates/etc/dovecot/conf.d/20-imapc.conf.j2 +++ /dev/null @@ -1,18 +0,0 @@ -# Smart IMAP proxying with imapc storage -# -# http://dovecot.org/pipermail/dovecot/2011-January/056975.html -# http://wiki2.dovecot.org/HowTo/ImapcProxy -# http://wiki2.dovecot.org/Migration/Dsync - -imapc_host = {{ IMAP }} -imapc_port = 143 -imapc_user = %u - -# Read multiple mails in parallel, improves performance -mail_prefetch_count = 20 - -# The list of valid features can be found there -# http://hg.dovecot.org/dovecot-2.1/file/f572fbafb445/src/lib-storage/index/imapc/imapc-settings.c -# (in the struct 'imapc_feature_list imapc_feature_list') -imapc_features = rfc822.size - diff --git a/roles/IMAP-proxy/templates/etc/dovecot/conf.d/auth-imap.conf.ext.j2 b/roles/IMAP-proxy/templates/etc/dovecot/conf.d/auth-imap.conf.ext.j2 deleted file mode 100644 index 5e2b28c..0000000 --- a/roles/IMAP-proxy/templates/etc/dovecot/conf.d/auth-imap.conf.ext.j2 +++ /dev/null @@ -1,17 +0,0 @@ -# Authentication via remote IMAP server. Included from auth.conf. -# -# - -passdb { - driver = imap - args = host={{ IMAP }} port=143 - default_fields = userdb_imapc_user=%u userdb_imapc_password=%w -} - -# "prefetch" user database means that the passdb already provided the -# needed information and there's no need to do a separate userdb lookup. -# -userdb { - driver = prefetch - default_fields = home=/home/imapproxy/%d/%n -} -- cgit v1.2.3