summaryrefslogtreecommitdiff
path: root/setup-mta.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2021-01-08 15:35:30 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2021-01-08 15:35:30 +0100
commit03384208e0e05697570ec8d61cf6bb940c9ee0a1 (patch)
tree70ceb530a7e2c8216b81539caae24d60ee06231c /setup-mta.in
parente5c17c7326676a78a09295baccabd83b10a69e33 (diff)
downloadalpine-conf-03384208e0e05697570ec8d61cf6bb940c9ee0a1.zip
setup-mta: cleanup. use ask
Diffstat (limited to 'setup-mta.in')
-rw-r--r--setup-mta.in12
1 files changed, 5 insertions, 7 deletions
diff --git a/setup-mta.in b/setup-mta.in
index 8a3f544..7ae0979 100644
--- a/setup-mta.in
+++ b/setup-mta.in
@@ -33,13 +33,11 @@ fi
res=
while [ "$res" != "221" ]; do
- echon "Outgoing mail server? (e.g 'smtp.isp.com') [$mailhub] "
- default_read mailhub $mailhub
- echon "Test connection? (y/n) [y] "
- default_read testconn "y"
- case "$testconn" in
- [Nn]*) break;;
- esac
+ ask "Outgoing mail server? (e.g 'smtp.isp.com')" "$mailhub"
+ mailhub="$resp"
+ if ! ask_yesno "Test connection? (y/n)" y; then
+ break
+ fi
res=$(echo -e "quit\r\n" | nc $mailhub 25 | awk '/^221/ {print $1}')
[ "x$res" = "x221" ] && echo "Connection to $mailhub is ok."
done