Просмотр исходного кода

Added --proxy to curl and updated the help info and the man page to display the practical use

of proxy
pull/1035/head
mojtabavahidinasab 1 месяц назад
Родитель
Сommit
ade5d0cd7f
2 измененных файлов: 7 добавлений и 2 удалений
  1. +4
    -2
      bin/mw
  2. +3
    -0
      mw.1

+ 4
- 2
bin/mw Просмотреть файл

@@ -221,7 +221,7 @@ getboxes() {
if [ -n "${force+x}" ]; then if [ -n "${force+x}" ]; then
mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")"
else 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 [ -z "$info" ] && errorexit
mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')" mailboxes="$(echo "$info" | grep -v HasChildren | sed "s/.*\" //;s/\"//g" | tr -d '\r')"
fi fi
@@ -301,6 +301,7 @@ Options allowed with -a:
-X Delete an account's local email too when deleting. -X Delete an account's local email too when deleting.
-o Configure address, but keep mail online. -o Configure address, but keep mail online.
-f Assume typical English mailboxes without attempting log-on. -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 NOTE: Once at least one account is added, you can run
\`mbsync -a\` to begin downloading mail. \`mbsync -a\` to begin downloading mail.
@@ -333,9 +334,10 @@ reorder() {
' "$tempfile" >>"$muttrc" ' "$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 ;; l) setact list ;;
r) setact reorder ;; r) setact reorder ;;
R) proxy="$OPTARG" ;;
d) setact delete ;; d) setact delete ;;
D) D)
setact delete setact delete


+ 3
- 0
mw.1 Просмотреть файл

@@ -73,6 +73,9 @@ Account password. You will be prompted for the password interactively if this op
.TP .TP
.B -P .B -P
Pass Prefix. The password will be stored using pass at <passprefix><email> 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 .SH OTHER OPTIONS
.TP .TP
.B -f .B -f


Загрузка…
Отмена
Сохранить