summaryrefslogtreecommitdiff
path: root/bin/mw
diff options
context:
space:
mode:
authorGianni Van Hoecke <gianni@giannivanhoecke.com>2021-01-22 20:33:29 +0100
committerGianni Van Hoecke <gianni@giannivanhoecke.com>2021-01-22 20:33:29 +0100
commit5920ca462db40309e927e1d58feb08023968e687 (patch)
tree6611b09ca9b9bc5aa8a219d2906e7421a05dae39 /bin/mw
parent79bb0437267b55a85bbdcf4f9b635be43091a73f (diff)
:bug: Supply imap port to curl login check
Part 2 of 2 for "Log-on not successful" bug when using ProtonMail. The curl login check uses the imap(s) protocol, which means it will use the default ports. However, when using ProtonMail, these ports are different (namely 1143 instead of 993). We now use the port variable in the curl login command, defaulting to 993 when the port was not overridden. The port variable was already set when the ProtonMail flag (-p) was set. Bug mentioned in: Fixes: - https://github.com/LukeSmithxyz/mutt-wizard/issues/608 - https://github.com/LukeSmithxyz/mutt-wizard/issues/622
Diffstat (limited to 'bin/mw')
-rwxr-xr-xbin/mw2
1 files changed, 1 insertions, 1 deletions
diff --git a/bin/mw b/bin/mw
index 30aabab..67c389d 100755
--- a/bin/mw
+++ b/bin/mw
@@ -236,7 +236,7 @@ Junk
Trash
Sent
Archive" && return 0
- info="$(curl --location-trusted -s -m 5 --user "$login:$(pass $pass_prefix$fulladdr)" --url "${protocol:-imaps}://$imap")"
+ info="$(curl --location-trusted -s -m 5 --user "$login:$(pass $pass_prefix$fulladdr)" --url "${protocol:-imaps}://$imap:${iport:-993}")"
[ -z "$info" ] && echo "Log-on not successful." && return 1
mailboxes="$(echo "$info" | sed "s/.*\" //;s/\"//g" | tr -d ' ')"
}