Disable service stats for Dovecot explicitly (#2292)

Co-authored-by: Casper <casperklein@users.noreply.github.com>

Co-authored-by: Casper <casperklein@users.noreply.github.com>
This commit is contained in:
Georg Lauterbach 2021-12-12 12:08:34 +01:00 committed by GitHub
parent c568e09e60
commit a4095a7d48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View file

@ -0,0 +1,25 @@
# Disable Dovecot's stats feature
#
# According to https://doc.dovecot.org/configuration_manual/service_configuration/
# setting mode to 0 disables the socket entirely.
service stats {
unix_listener stats-reader {
mode = 0
}
unix_listener stats-writer {
mode = 0
}
}
service old-stats {
fifo_listener old-stats-mail {
mode = 0
}
fifo_listener old-stats-user {
mode = 0
}
unix_listener old-stats {
mode = 0
}
}

View file

@ -186,6 +186,11 @@ function _setup_dovecot
sed -i -e 's|#ssl = yes|ssl = required|g' /etc/dovecot/conf.d/10-ssl.conf
sed -i 's|^postmaster_address = .*$|postmaster_address = '"${POSTMASTER_ADDRESS}"'|g' /etc/dovecot/conf.d/15-lda.conf
if ! grep -q -E '^stats_writer_socket_path=' /etc/dovecot/dovecot.conf
then
printf '\nstats_writer_socket_path=\n' >>/etc/dovecot/dovecot.conf
fi
# set mail_location according to mailbox format
case "${DOVECOT_MAILBOX_FORMAT}" in
"sdbox" | "mdbox" )