Browse Source

Added option to provide self-signed certificate

pull/942/head
kkoyung 1 year ago
parent
commit
b83180266f
2 changed files with 13 additions and 2 deletions
  1. +9
    -2
      bin/mw
  2. +4
    -0
      mw.1

+ 9
- 2
bin/mw View File

@@ -214,7 +214,8 @@ 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}")"
[ ! -z "$sslcertself" ] && addarg="-k"
info="$(curl "$addarg" --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
@@ -294,6 +295,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.
-c Path to self-signed TLS certificate.


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.
@@ -326,7 +328,7 @@ 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:c:" o; do case "${o}" in
l) setact list ;; l) setact list ;;
r) setact reorder1 ;; r) setact reorder1 ;;
d) setact delete ;; d) setact delete ;;
@@ -393,6 +395,11 @@ while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:" o; do case "${o}" in
setact add setact add
password="$OPTARG" password="$OPTARG"
;; ;;
c)
setact add
sslcertself="$OPTARG"
sslcert="$OPTARG"
;;
X) X)
setact delete setact delete
purge=True purge=True


+ 4
- 0
mw.1 View File

@@ -70,8 +70,12 @@ SMTP server port (assumed to be 465 if not specified)
.TP .TP
.B -x .B -x
Account password. You will be prompted for the password interactively if this option is not given. Account password. You will be prompted for the password interactively if this option is not given.
.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 -c certificate
Self-signed TLS certificate
.SH OTHER OPTIONS .SH OTHER OPTIONS
.TP .TP
.B -f .B -f


Loading…
Cancel
Save