fix: double occurence of `/etc/postfix/regexp` (#2397)
This commit is contained in:
parent
4c3af32692
commit
ce9e86c462
|
@ -43,9 +43,13 @@ function _handle_postfix_regexp_config
|
||||||
_notify 'inf' "Adding regexp alias file postfix-regexp.cf"
|
_notify 'inf' "Adding regexp alias file postfix-regexp.cf"
|
||||||
|
|
||||||
cp -f /tmp/docker-mailserver/postfix-regexp.cf /etc/postfix/regexp
|
cp -f /tmp/docker-mailserver/postfix-regexp.cf /etc/postfix/regexp
|
||||||
sed -i -E \
|
|
||||||
's|virtual_alias_maps(.*)|virtual_alias_maps\1 pcre:/etc/postfix/regexp|g' \
|
if ! grep 'virtual_alias_maps.*pcre:/etc/postfix/regexp' /etc/postfix/main.cf
|
||||||
/etc/postfix/main.cf
|
then
|
||||||
|
sed -i -E \
|
||||||
|
's|virtual_alias_maps(.*)|virtual_alias_maps\1 pcre:/etc/postfix/regexp|g' \
|
||||||
|
/etc/postfix/main.cf
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,7 +57,7 @@ function _handle_postfix_aliases_config
|
||||||
{
|
{
|
||||||
_notify 'inf' 'Configuring root alias'
|
_notify 'inf' 'Configuring root alias'
|
||||||
|
|
||||||
echo "root: ${POSTMASTER_ADDRESS}" > /etc/aliases
|
echo "root: ${POSTMASTER_ADDRESS}" >/etc/aliases
|
||||||
|
|
||||||
if [[ -f /tmp/docker-mailserver/postfix-aliases.cf ]]
|
if [[ -f /tmp/docker-mailserver/postfix-aliases.cf ]]
|
||||||
then
|
then
|
||||||
|
|
|
@ -342,7 +342,7 @@ function _setup_dovecot_local_user
|
||||||
|
|
||||||
function _setup_ldap
|
function _setup_ldap
|
||||||
{
|
{
|
||||||
_notify 'task' 'Setting up Ldap'
|
_notify 'task' 'Setting up LDAP'
|
||||||
_notify 'inf' 'Checking for custom configs'
|
_notify 'inf' 'Checking for custom configs'
|
||||||
|
|
||||||
for i in 'users' 'groups' 'aliases' 'domains'
|
for i in 'users' 'groups' 'aliases' 'domains'
|
||||||
|
@ -404,7 +404,7 @@ function _setup_ldap
|
||||||
# add domainname to vhost
|
# add domainname to vhost
|
||||||
echo "${DOMAINNAME}" >>/tmp/vhost.tmp
|
echo "${DOMAINNAME}" >>/tmp/vhost.tmp
|
||||||
|
|
||||||
_notify 'inf' "Enabling dovecot LDAP authentification"
|
_notify 'inf' 'Enabling dovecot LDAP authentification'
|
||||||
|
|
||||||
sed -i -e '/\!include auth-ldap\.conf\.ext/s/^#//' /etc/dovecot/conf.d/10-auth.conf
|
sed -i -e '/\!include auth-ldap\.conf\.ext/s/^#//' /etc/dovecot/conf.d/10-auth.conf
|
||||||
sed -i -e '/\!include auth-passwdfile\.inc/s/^/#/' /etc/dovecot/conf.d/10-auth.conf
|
sed -i -e '/\!include auth-passwdfile\.inc/s/^/#/' /etc/dovecot/conf.d/10-auth.conf
|
||||||
|
@ -413,20 +413,23 @@ function _setup_ldap
|
||||||
|
|
||||||
if [[ -f /etc/postfix/ldap-users.cf ]]
|
if [[ -f /etc/postfix/ldap-users.cf ]]
|
||||||
then
|
then
|
||||||
postconf -e "virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf" || \
|
postconf -e "virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf"
|
||||||
_notify 'inf' "==> Warning: /etc/postfix/ldap-user.cf not found"
|
else
|
||||||
|
_notify 'war' "'/etc/postfix/ldap-users.cf' not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /etc/postfix/ldap-domains.cf ]]
|
if [[ -f /etc/postfix/ldap-domains.cf ]]
|
||||||
then
|
then
|
||||||
postconf -e "virtual_mailbox_domains = /etc/postfix/vhost, ldap:/etc/postfix/ldap-domains.cf" || \
|
postconf -e "virtual_mailbox_domains = /etc/postfix/vhost, ldap:/etc/postfix/ldap-domains.cf"
|
||||||
_notify 'inf' "==> Warning: /etc/postfix/ldap-domains.cf not found"
|
else
|
||||||
|
_notify 'war' "'/etc/postfix/ldap-domains.cf' not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -f /etc/postfix/ldap-aliases.cf ]] && [[ -f /etc/postfix/ldap-groups.cf ]]
|
if [[ -f /etc/postfix/ldap-aliases.cf ]] && [[ -f /etc/postfix/ldap-groups.cf ]]
|
||||||
then
|
then
|
||||||
postconf -e "virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-groups.cf" || \
|
postconf -e "virtual_alias_maps = ldap:/etc/postfix/ldap-aliases.cf, ldap:/etc/postfix/ldap-groups.cf"
|
||||||
_notify 'inf' "==> Warning: /etc/postfix/ldap-aliases.cf or /etc/postfix/ldap-groups.cf not found"
|
else
|
||||||
|
_notify 'war' "'/etc/postfix/ldap-aliases.cf' and / or '/etc/postfix/ldap-groups.cf' not found"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
|
|
Loading…
Reference in New Issue