summaryrefslogtreecommitdiff
path: root/postfix
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2016-11-17 14:48:24 +0100
committerJonas Smedegaard <dr@jones.dk>2016-11-17 14:48:24 +0100
commitf41a98b7f4e0c85491aabdfcd649b771fa042161 (patch)
tree3a5a49a7775db2393bf07e9fbc426e2b65951dfa /postfix
parent8b679b4fc0619d86cc4f9ca49bf6ed8eeb0bc235 (diff)
Fix detect postfix >= 3, and stop check for obsolete postfix < 2.2.
Diffstat (limited to 'postfix')
-rwxr-xr-xpostfix/postfix.sh6
1 files changed, 1 insertions, 5 deletions
diff --git a/postfix/postfix.sh b/postfix/postfix.sh
index bd62e8b..2aca3e7 100755
--- a/postfix/postfix.sh
+++ b/postfix/postfix.sh
@@ -44,11 +44,7 @@ configdirs='/etc/local /etc/local-ORG /etc/local-REDPILL /etc/local-COMMON'
confdir='/etc/postfix'
postconf=/usr/sbin/postconf
sp='[[:space:]]'
-pfver="$($postconf -d mail_version | cut -d= -f2 -s)"
-echo "$pfver" | grep -qP '2\.([2-9]|1\d)(\.\d)?$' \
- || exit1 "ERROR: Bad postfix version - this script is known to work only for postfix 2.2 and later"
-pf23=
-! echo "$pfver" | grep -qP '2\.([3-9]|1\d)(\.\d)?$' || pf23=1
+pf23="$($postconf -d mail_version | grep -Po '= \K([3-9]|2\.[3-9])(\.[0-9])*$')"
if ! [ -d "$realmsdir" ]; then
warn "Realms directory \"$realmsdir\" does not exist."
fi