From 8a4c7ca9ae67c53c63ebcbbc25c0ecaa6d759044 Mon Sep 17 00:00:00 2001 From: kkoyung Date: Mon, 25 Dec 2023 21:04:53 +0800 Subject: [PATCH] Fixed "URL rejected: Malformed input to a URL function" issue --- bin/mw | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/mw b/bin/mw index bf87d48..9f44239 100755 --- a/bin/mw +++ b/bin/mw @@ -214,7 +214,9 @@ getboxes() { if [ -n "${force+x}" ]; then mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" else - info="$(curl "$curlarg" --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" + [ -n "$sslcert" ] \ + && info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" \ + || info="$(curl -k --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" [ -z "$info" ] && errorexit mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" fi @@ -397,7 +399,6 @@ while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:c:" o; do case "${o}" in c) setact add sslcert="$OPTARG" - curlarg="$curlarg -k" ;; X) setact delete