From ade5d0cd7f991556287402cd492c00464e4d1c97 Mon Sep 17 00:00:00 2001 From: mojtabavahidinasab Date: Sat, 18 Jul 2026 14:48:26 +0330 Subject: Added --proxy to curl and updated the help info and the man page to display the practical use of proxy --- bin/mw | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/mw b/bin/mw index ab779f3..18ef9c2 100755 --- a/bin/mw +++ b/bin/mw @@ -221,7 +221,7 @@ getboxes() { if [ -n "${force+x}" ]; then mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" else - info="$(curl --location-trusted -s -m 5 --user "$login:$(pass "$passprefix$fulladdr")" --url "${protocol:-imaps}://$imap:${iport:-993}")" + info="$(curl --proxy "$proxy" --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 @@ -301,6 +301,7 @@ Options allowed with -a: -X Delete an account's local email too when deleting. -o Configure address, but keep mail online. -f Assume typical English mailboxes without attempting log-on. + -R Use a proxy server for curl (useful for bypassing network restrictions) NOTE: Once at least one account is added, you can run \`mbsync -a\` to begin downloading mail. @@ -333,9 +334,10 @@ reorder() { ' "$tempfile" >>"$muttrc" } -while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:" o; do case "${o}" in +while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:R:" o; do case "${o}" in l) setact list ;; r) setact reorder ;; + R) proxy="$OPTARG" ;; d) setact delete ;; D) setact delete -- cgit v1.2.3