summaryrefslogtreecommitdiff
path: root/postfix
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-02-21 00:27:17 +0100
committerJonas Smedegaard <dr@jones.dk>2015-02-21 00:27:30 +0100
commit764a6117925274383aee22debe885e29ea4acbb4 (patch)
treec9cea014b930d941094cc69e38bcb2c69b758f01 /postfix
parent6d07f4cbdeca080798c927b8ad82d5634c92c3bf (diff)
Fix detect Postfix versions 2.10 and newer.
Diffstat (limited to 'postfix')
-rwxr-xr-xpostfix/postfix.sh6
1 files changed, 3 insertions, 3 deletions
diff --git a/postfix/postfix.sh b/postfix/postfix.sh
index f0cde00..2aecd0d 100755
--- a/postfix/postfix.sh
+++ b/postfix/postfix.sh
@@ -44,10 +44,10 @@ confdir='/etc/postfix'
postconf=/usr/sbin/postconf
sp='[[:space:]]'
pfver="$($postconf -d mail_version | cut -d= -f2 -s)"
-echo "$pfver" | grep -q '2\.[2-9]' \
+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 -q '2\.[3-9]' || pf23=1
+! echo "$pfver" | grep -P '2\.([3-9]|1\d)(\.\d)?$' || pf23=1
if ! [ -d "$realmsdir" ]; then
warn "Realms directory \"$realmsdir\" does not exist."
fi
@@ -340,6 +340,7 @@ if [ -n "$sslcert" ]; then
$postconf -c "$tempdir" -e 'smtpd_sasl_auth_enable = no' # SASL is enabled explicitly with TLS transport
$postconf -c "$tempdir" -e 'smtpd_sasl_security_options = noanonymous'
$postconf -c "$tempdir" -e 'smtpd_sasl_local_domain = '
+ -o smtpd_sasl_local_domain=\$mydomain
$postconf -c "$tempdir" -e 'smtpd_tls_received_header = yes'
$postconf -c "$tempdir" -e 'broken_sasl_auth_clients = yes'
$postconf -c "$tempdir" -e 'tls_random_source = dev:/dev/urandom'
@@ -434,7 +435,6 @@ submission inet n - n - - smtpd
-o syslog_name=postfix/submission
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
- -o smtpd_sasl_local_domain=\$mydomain
EOF
addoroverwritewithindents $tempdir/master.cf '^pickup\h' << EOF
pickup fifo n - - 60 1 pickup