[enh] Allow for dovecot configuration extensions

This commit is contained in:
Julien Malik 2016-09-09 17:12:50 +02:00
parent 7b48d7b9fa
commit ea17e9fa80
4 changed files with 14 additions and 0 deletions

View file

@ -26,11 +26,18 @@ do_pre_regen() {
's/^\(listen =\).*/\1 */' \ 's/^\(listen =\).*/\1 */' \
"${dovecot_dir}/dovecot.conf" "${dovecot_dir}/dovecot.conf"
fi fi
mkdir -p "${dovecot_dir}/yunohost.d"
cp pre-ext.conf "${dovecot_dir}/yunohost.d"
cp post-ext.conf "${dovecot_dir}/yunohost.d"
} }
do_post_regen() { do_post_regen() {
regen_conf_files=$1 regen_conf_files=$1
sudo mkdir -p "/etc/dovecot/yunohost.d/pre-ext.d"
sudo mkdir -p "/etc/dovecot/yunohost.d/post-ext.d"
# create vmail user # create vmail user
id vmail > /dev/null 2>&1 \ id vmail > /dev/null 2>&1 \
|| sudo adduser --system --ingroup mail --uid 500 vmail || sudo adduser --system --ingroup mail --uid 500 vmail

View file

@ -1,3 +1,5 @@
!include yunohost.d/pre-ext.conf
listen = *, :: listen = *, ::
auth_mechanisms = plain login auth_mechanisms = plain login
@ -10,6 +12,7 @@ protocols = imap sieve
mail_plugins = $mail_plugins quota mail_plugins = $mail_plugins quota
ssl = yes ssl = yes
ssl_cert = </etc/yunohost/certs/{{ main_domain }}/crt.pem ssl_cert = </etc/yunohost/certs/{{ main_domain }}/crt.pem
ssl_key = </etc/yunohost/certs/{{ main_domain }}/key.pem ssl_key = </etc/yunohost/certs/{{ main_domain }}/key.pem
@ -30,6 +33,7 @@ protocol imap {
mail_plugins = $mail_plugins imap_quota antispam mail_plugins = $mail_plugins imap_quota antispam
} }
protocol lda { protocol lda {
auth_socket_path = /var/run/dovecot/auth-master auth_socket_path = /var/run/dovecot/auth-master
mail_plugins = quota sieve mail_plugins = quota sieve
@ -89,3 +93,4 @@ plugin {
quota_warning3 = -storage=100%% quota-warning below %u # user is no longer over quota quota_warning3 = -storage=100%% quota-warning below %u # user is no longer over quota
} }
!include yunohost.d/post-ext.conf

View file

@ -0,0 +1 @@
!include_try post-ext.d/*.conf

View file

@ -0,0 +1 @@
!include_try pre-ext.d/*.conf