diff options
Diffstat (limited to 'user/netqmail/netqmail.initd')
-rw-r--r-- | user/netqmail/netqmail.initd | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/user/netqmail/netqmail.initd b/user/netqmail/netqmail.initd index 36e43e74e..1c7552df3 100644 --- a/user/netqmail/netqmail.initd +++ b/user/netqmail/netqmail.initd @@ -13,15 +13,19 @@ makesmtpd() set -e ip="$1" ext="$2" - if s6-tcpserver6-socketbinder -dBb0 -- "$ip" 25 true 2>/dev/null ; then + + if echo "$ip" | grep -qF : ; then ipv=6 relayfor="$smtprelay6" - elif s6-tcpserver4-socketbinder -dBb0 -- "$ip" 25 true 2>/dev/null ; then + elif echo "$ip" | grep -qF . ; then ipv=4 relayfor="$smtprelay4" else return 1 fi + if ! s6-tcpserver-socketbinder -dBb0 -- "$ip" 25 true 2>/dev/null ; then + return 1 + fi service="smtpd-$ip" sdir=/run/services/"$service" @@ -32,7 +36,7 @@ makesmtpd() chmod 2700 "$logdir" rm -rf "$sdir" - cp -a /etc/qmail/services/smtpd"${ipv}"-skeleton"$ext" "$sdir" + cp -a /etc/qmail/services/smtpd-skeleton"$ext" "$sdir" echo "$ip" > "$sdir"/env/IP echo "$KEYFILE" > "$sdir"/env/KEYFILE echo "$CERTFILE" > "$sdir"/env/CERTFILE |