summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormojtabavahidinasab <mojtabavahidinasab@grrlz.net>2026-07-18 14:48:26 +0330
committermojtabavahidinasab <mojtabavahidinasab@grrlz.net>2026-07-18 14:48:26 +0330
commitade5d0cd7f991556287402cd492c00464e4d1c97 (patch)
treec0ebfc83b8514c12ea2193363bb775975bdad740
parente3225995c23a3aac69e41e1b29bca2c205dfdff1 (diff)
Added --proxy to curl and updated the help info and the man page to display the practical use
of proxy
-rwxr-xr-xbin/mw6
-rw-r--r--mw.13
2 files changed, 7 insertions, 2 deletions
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
diff --git a/mw.1 b/mw.1
index f40db45..d442ed0 100644
--- a/mw.1
+++ b/mw.1
@@ -73,6 +73,9 @@ Account password. You will be prompted for the password interactively if this op
.TP
.B -P
Pass Prefix. The password will be stored using pass at <passprefix><email>
+.TP
+.B -R
+Use a proxy server for curl (useful for bypassing network restrictions)
.SH OTHER OPTIONS
.TP
.B -f