mirror of
https://github.com/bokysan/docker-postfix.git
synced 2024-09-20 06:46:10 +08:00
Fix: Make sure to use the proper name for pluginviewer based on distro
Debian/Ubuntu use 'saslpluginviewer`, so we should check for that.
This commit is contained in:
parent
945add7f9d
commit
e8c6cd5332
|
@ -7,7 +7,7 @@ fi
|
|||
|
||||
do_alpine() {
|
||||
apk update
|
||||
apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm
|
||||
apk add --upgrade cyrus-sasl cyrus-sasl-static cyrus-sasl-digestmd5 cyrus-sasl-crammd5 cyrus-sasl-login cyrus-sasl-ntlm libsasl
|
||||
apk add postfix
|
||||
apk add opendkim
|
||||
apk add --upgrade ca-certificates tzdata supervisor rsyslog musl musl-utils bash opendkim-utils libcurl jsoncpp lmdb logrotate netcat-openbsd
|
||||
|
@ -21,7 +21,7 @@ do_ubuntu() {
|
|||
export DEBIAN_FRONTEND=noninteractive
|
||||
echo "Europe/Berlin" > /etc/timezone
|
||||
apt-get update -y -q
|
||||
apt-get install -y libsasl2-modules
|
||||
apt-get install -y libsasl2-modules sasl2-bin
|
||||
apt-get install -y postfix
|
||||
apt-get install -y opendkim
|
||||
apt-get install -y ca-certificates tzdata supervisor rsyslog bash opendkim-tools curl libcurl4 libjsoncpp25 sasl2-bin postfix-lmdb logrotate cron net-tools ${RELEASE_SPECIFIC_PACKAGES}
|
||||
|
|
|
@ -10,4 +10,9 @@ fi
|
|||
if ! hash nc; then
|
||||
echo "netcat not found!" >2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! hash pluginviewer && ! hash saslpluginviewer; then
|
||||
echo "pluginviewer not found!" >2
|
||||
exit 1
|
||||
fi
|
|
@ -325,6 +325,7 @@ EOF
|
|||
|
||||
postfix_setup_xoauth2_post_setup() {
|
||||
local other_plugins
|
||||
local plugin_viewer="pluginviewer"
|
||||
if [ -n "$XOAUTH2_CLIENT_ID" ] || [ -n "$XOAUTH2_SECRET" ]; then
|
||||
do_postconf -e 'smtp_sasl_security_options='
|
||||
do_postconf -e 'smtp_sasl_mechanism_filter=xoauth2'
|
||||
|
@ -338,7 +339,12 @@ postfix_setup_xoauth2_post_setup() {
|
|||
#
|
||||
# The fix is therefore simple: If we're not using OAuth2, we remove the plugin from the list and
|
||||
# keep all the plugins installed.
|
||||
other_plugins="$(pluginviewer -c | grep Plugin | cut -d\ -f2 | cut -c2- | rev | cut -c2- | rev | grep -v EXTERNAL | grep -v sasl-xoauth2 | tr '\n' ',' | rev | cut -c2- | rev)"
|
||||
|
||||
if hash saslpluginviewer > /dev/null 2>&1; then
|
||||
# Ubuntu/Debian have renamed pluginviewer to saslpluginviewer so this fails with those distros.
|
||||
plugin_viewer="saslpluginviewer"
|
||||
fi
|
||||
other_plugins="$(${plugin_viewer} -c | grep Plugin | cut -d\ -f2 | cut -c2- | rev | cut -c2- | rev | grep -v EXTERNAL | grep -v sasl-xoauth2 | tr '\n' ',' | rev | cut -c2- | rev)"
|
||||
do_postconf -e "smtp_sasl_mechanism_filter=${other_plugins}"
|
||||
fi
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue