diff options
author | Laurent Bercot <ska-adelie@skarnet.org> | 2023-11-06 23:59:16 +0000 |
---|---|---|
committer | Laurent Bercot <ska-adelie@skarnet.org> | 2023-11-06 23:59:16 +0000 |
commit | 4b502e6131122d630e54f2b173a7558f387dd6e1 (patch) | |
tree | 89ef6de98d816399b85f06430b5a1d92fb1e00e9 /user/netqmail/netqmail.initd | |
parent | 7934b6b3d5cc90fa95ad4cd12e356e9a0d368c51 (diff) | |
download | packages-4b502e6131122d630e54f2b173a7558f387dd6e1.tar.gz packages-4b502e6131122d630e54f2b173a7558f387dd6e1.tar.bz2 packages-4b502e6131122d630e54f2b173a7558f387dd6e1.tar.xz packages-4b502e6131122d630e54f2b173a7558f387dd6e1.zip |
user/netqmail: adapt to s6-networking-2.6.0.0
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 |