Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow user to provide self-signed certificate #942

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions bin/mw
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,9 @@ 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}")"
[ -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
Expand Down Expand Up @@ -288,6 +290,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.
-c Path to self-signed TLS certificate.

NOTE: Once at least one account is added, you can run
\`mbsync -a\` to begin downloading mail.
Expand Down Expand Up @@ -320,7 +323,7 @@ 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:c:" o; do case "${o}" in
l) setact list ;;
r) setact reorder ;;
d) setact delete ;;
Expand Down Expand Up @@ -387,6 +390,10 @@ while getopts "rfpXlhodTYD:y:i:I:s:S:u:a:n:P:x:m:t:" o; do case "${o}" in
setact add
password="$OPTARG"
;;
c)
setact add
sslcert="$OPTARG"
;;
X)
setact delete
purge=True
Expand Down
4 changes: 4 additions & 0 deletions mw.1
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,12 @@ SMTP server port (assumed to be 465 if not specified)
.TP
.B -x
Account password. You will be prompted for the password interactively if this option is not given.
.TP
.B -P
Pass Prefix. The password will be stored using pass at <passprefix><email>
.TP
.B -c path
Path to self-signed TLS certificate
.SH OTHER OPTIONS
.TP
.B -f
Expand Down