diff options
Diffstat (limited to 'playbooks/roles/mail/templates/volumes/data')
12 files changed, 75 insertions, 0 deletions
diff --git a/playbooks/roles/mail/templates/volumes/data/.gitkeep b/playbooks/roles/mail/templates/volumes/data/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/dms/.gitkeep b/playbooks/roles/mail/templates/volumes/data/dms/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/dms/config/dovecot-ldap.conf b/playbooks/roles/mail/templates/volumes/data/dms/config/dovecot-ldap.conf new file mode 100644 index 0000000..956942c --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/config/dovecot-ldap.conf @@ -0,0 +1,11 @@ +base = {{ ldap_search_base }} +uris = {{ ldap_server_host }} +tls = no +ldap_version = 3 +default_pass_scheme = SSHA +dn = {{ ldap_bind_dn }} +dnpass = {{ email_ldap_api_token }} + +auth_bind = yes +auth_bind_userdn = {{ dovecot_auth_bind_userdn }} +user_filter = {{ dovecot_user_filter }} diff --git a/playbooks/roles/mail/templates/volumes/data/dms/config/user-patches.sh b/playbooks/roles/mail/templates/volumes/data/dms/config/user-patches.sh new file mode 100755 index 0000000..c62753f --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/config/user-patches.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +postconf -e 'smtpd_sasl_type = dovecot' +postconf -e 'smtpd_sasl_path = /dev/shm/sasl-auth.sock' +postconf -e 'smtpd_sasl_auth_enable = yes' +postconf -e 'broken_sasl_auth_clients = yes' + +postconf -e 'smtp_tls_wrappermode = yes' # for relay + +# This is necessary for any users with multiple email addresses. Kanidm stores all email addresses in +# the mail attribute, which means that postfix clones emails to all addresses. Since dovecot only +# has a mailbox for the primary email address, the other addresses will bounce, and the sender +# will receive a bounce message. Kanidm provides the "primary" (first) email address in the +# emailprimary attribute, so we use that instead. +# +# We don't change the ldap-sender.cf or ldap-groups.cf files because we want people to be able to +# send mail from any of their email addresses, not just the primary one, and we want email to +# groups to be delivered regardless of which email it arrives at. +sed -i 's/result_attribute = mail/result_attribute = emailprimary/' /etc/postfix/ldap-aliases.cf +sed -i 's/result_attribute = mail/result_attribute = emailprimary/' /etc/postfix/ldap-domains.cf +sed -i 's/result_attribute = mail/result_attribute = emailprimary/' /etc/postfix/ldap-users.cf + +echo 'auth_username_format = %Ln' >> /etc/dovecot/conf.d/10-auth.conf + +echo 'username_format = %Ln' >> /etc/dovecot/dovecot-oauth2.conf.ext + +echo "passdb { + driver = ldap + args = /etc/dovecot/dovecot-ldap.conf.ext +} + +userdb { + driver = static + args = username_format=%u uid=docker gid=docker home=/var/mail/%d/%u + default_fields = uid=docker gid=docker home=/var/mail/%d/%u +}" > /etc/dovecot/conf.d/auth-ldap.conf.ext + +#userdb { +# driver = static +# args = home=/var/mail/%u +#}" diff --git a/playbooks/roles/mail/templates/volumes/data/dms/mail-logs/.gitkeep b/playbooks/roles/mail/templates/volumes/data/dms/mail-logs/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/mail-logs/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/dms/mail-state/.gitkeep b/playbooks/roles/mail/templates/volumes/data/dms/mail-state/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/mail-state/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/dms/vmail/.gitkeep b/playbooks/roles/mail/templates/volumes/data/dms/vmail/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/dms/vmail/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/roundcube/.gitkeep b/playbooks/roles/mail/templates/volumes/data/roundcube/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/roundcube/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/roundcube/config/.gitkeep b/playbooks/roles/mail/templates/volumes/data/roundcube/config/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/roundcube/config/.gitkeep diff --git a/playbooks/roles/mail/templates/volumes/data/roundcube/config/oauth2.inc.php b/playbooks/roles/mail/templates/volumes/data/roundcube/config/oauth2.inc.php new file mode 100644 index 0000000..0284e9e --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/roundcube/config/oauth2.inc.php @@ -0,0 +1,19 @@ +<?php + +$config['oauth_provider'] = 'generic'; +$config['oauth_provider_name'] = '{{ domain }} <3'; +$config['oauth_client_id'] = '{{ roundcube_oauth2_client_id }}'; +$config['oauth_client_secret'] = '{{ roundcube_oauth2_client_basic_secret }}'; +$config['oauth_auth_uri'] = '{{ roundcube_oauth2_auth_uri }}'; +$config['oauth_token_uri'] = '{{ roundcube_oauth2_token_uri }}'; +$config['oauth_identity_uri'] = '{{ roundcube_oauth2_user_uri }}'; + +$config['oauth_verify_peer'] = true; + +$config['oauth_scope'] = 'email openid profile'; +$config['oauth_identity_fields'] = ['email']; + +$config['oauth_login_redirect'] = false; + +$config['force_https'] = true; +$config['use_https'] = true; diff --git a/playbooks/roles/mail/templates/volumes/data/roundcube/config/sieve.inc.php b/playbooks/roles/mail/templates/volumes/data/roundcube/config/sieve.inc.php new file mode 100644 index 0000000..e7b08b0 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/roundcube/config/sieve.inc.php @@ -0,0 +1,4 @@ +<?php + +$config['managesieve_host'] = "tls://{{ mail_domain }}"; +$config['managesieve_auth_type'] = "PLAIN"; diff --git a/playbooks/roles/mail/templates/volumes/data/roundcube/db/.gitkeep b/playbooks/roles/mail/templates/volumes/data/roundcube/db/.gitkeep new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/playbooks/roles/mail/templates/volumes/data/roundcube/db/.gitkeep |