mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2024-01-19 02:48:50 +00:00
fix: Amavis should reload config for /etc/postfix/vhost
updates (#2616)
* fix: Reload `amavisd-new` when vhost config is updated Amavis was not aware of new domains in `/etc/postfix/vhost` as it did not refresh it's sources upon change detection.
This commit is contained in:
parent
ea8e293dcc
commit
7fe2f21df4
|
@ -59,6 +59,8 @@ function _check_for_changes
|
|||
# While some config changes may be properly applied by Postfix or Dovecot
|
||||
# via their 'reload' commands; some may require restarting?:
|
||||
_log_with_date 'debug' 'Restarting services due to detected changes'
|
||||
|
||||
[[ ${ENABLE_AMAVIS} -eq 1 ]] && _reload_amavis
|
||||
supervisorctl restart postfix
|
||||
[[ ${SMTP_ONLY} -ne 1 ]] && supervisorctl restart dovecot
|
||||
|
||||
|
@ -86,6 +88,16 @@ function _get_changed_files
|
|||
grep -Fxvf "${CHKSUM_CURRENT}" "${CHKSUM_NEW}" | sed -r 's/^\S+[[:space:]]+//'
|
||||
}
|
||||
|
||||
function _reload_amavis
|
||||
{
|
||||
if [[ ${CHANGED} =~ ${DMS_DIR}/postfix-accounts.cf ]] || [[ ${CHANGED} =~ ${DMS_DIR}/postfix-virtual.cf ]]
|
||||
then
|
||||
# /etc/postfix/vhost was updated, amavis must refresh it's config by
|
||||
# reading this file again in case of new domains, otherwise they will be ignored.
|
||||
amavisd-new reload
|
||||
fi
|
||||
}
|
||||
|
||||
# Also note that changes are performed in place and are not atomic
|
||||
# We should fix that and write to temporary files, stop, swap and start
|
||||
function _postfix_dovecot_changes
|
||||
|
|
Loading…
Reference in a new issue