Browse Source

debug last change

pull/276/head
Roland Puntaier 5 years ago
parent
commit
36498079d4
2 changed files with 11 additions and 9 deletions
  1. +10
    -8
      bin/mw
  2. +1
    -1
      test/dotests

+ 10
- 8
bin/mw View File

@@ -154,9 +154,9 @@ askinfo() {
printf "\033[0m"
done
fi
domain="$(echo "$mwaddr" | sed "s/.*@//")"
printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$domain"
mwserverinfo="$(grep "^$domain" "$mwshare/domains.csv" 2>/dev/null)"
mwdomain="$(echo "$mwaddr" | sed "s/.*@//")"
printf "\\nSearching for \033[32m%s\033[0m in \033[34m\`domains.csv\`\033[0m..." "$mwdomain"
mwserverinfo="$(grep "^$mwdomain" "$mwshare/domains.csv" 2>/dev/null)"
if [ -z "$mwserverinfo" ]; then
printf "Your email domain is not known to mutt-wizard.\\nType in your settings.\\nUsually you find them by an internet search.\\n"
printf "Type the IMAP server (excluding the port number)\\n\033[36m\t"
@@ -167,12 +167,12 @@ askinfo() {
read -r mwsmtp
printf "\033[0mSMTP port number (usually 587 or 465)\\n\033[36m\t"
read -r mwsport
printf "\033[0m\\nIf you want, you can copy the line below and add it to the \`domains.csv\` file on Github, for others.\\n\\n%s,%s,%s,%s,%s\\n\\nBut be sure the setting works, first! ;-)\\n" "$domain" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport"
printf "\033[0m\\nIf you want, you can copy the line below and add it to the \`domains.csv\` file on Github, for others.\\n\\n%s,%s,%s,%s,%s\\n\\nBut be sure the setting works, first! ;-)\\n" "$mwdomain" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport"
else
IFS=, read -r mwservice mwimap mwiport mwsmtp mwsport <<EOF
$mwserverinfo
EOF
printf "\\n\033[3;33mCongrats!\033[0m Server info is known, so you don't need to look it up!\\n\t\033[1mIMAP server\033[0m: %s\\n\t\033[1mIMAP port\033[0m: %s\\n\t\033[1mSMTP server\033[0m: %s\\n\t\033[1mSMTP port\033[0m: %s\\n" "$imap" "$mwiport" "$mwsmtp" "$mwsport"
printf "\\n\033[3;33mCongrats!\033[0m Server info is known, so you don't need to look it up!\\n\t\033[1mIMAP server\033[0m: %s\\n\t\033[1mIMAP port\033[0m: %s\\n\t\033[1mSMTP server\033[0m: %s\\n\t\033[1mSMTP port\033[0m: %s\\n" "$mwimap" "$mwiport" "$mwsmtp" "$mwsport"
case "$mwservice" in
gmail.com) printf "\033[31mGmail: \"less secure\" must be enabled before you continue.\\nDo it now, if you have not done it already:\\nhttps://support.google.com/accounts/answer/6010255\\n\033[0m" ;;
protonmail.ch|protonmail.com|pm.me) printf "\033[31mProtonmail: Users must install and configure Protonmail Bridge for the sync to work:\\nhttps://protonmail.com/bridge/\\n\033[0m" && ssltype="None" ;;
@@ -273,9 +273,11 @@ finalize() {
echo "$boxes" | grep -i archive | head -n 1 | formatShortcut a archive
idnum=${mwaccrc%%-*}
muttsync="<sync-mailbox><enter-command>source $mwaccrc<enter><change-folder>\!<enter>;<check-stats>"
echo "folder-hook \$folder '$muttsync' # mw-autogenerated" >> "$mwaccrc"
echo "macro index,pager i$idnum $muttsync \"switch to $mwaddr\" # mw-autogenerated" >> "$mwaccrc"
[ "$mwtype" = "offline" ] && printf "All done.\\n\033[33mYou can now run \`\033[32mmailsync [%s]\033[33m\` to sync your mail.\033[0m\\n" "$mwaccount"
echo "macro index,pager i$idnum '$muttsync' \"switch to $mwaddr\" # mw-autogenerated" >> "$mwaccrc"
if [ "$mwtype" = "offline" ]; then
echo "folder-hook \$folder '$muttsync' # mw-autogenerated" >> "$mwaccrc"
printf "All done.\\n\033[33mYou can now run \`\033[32mmailsync [%s]\033[33m\` to sync your mail.\033[0m\\n" "$mwaccount"
fi
command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview"
return 0
}


+ 1
- 1
test/dotests View File

@@ -23,7 +23,7 @@ rm -rf $mwmaildir/$mwaddr
export mwmaildir=$MAILDIR
export mwname='r n'
export mwlogin=$mwaddr
export mwpass="${mwpass:-mutt-wizard-$mwaddr}
export mwpass="${mwpass:-mutt-wizard-$mwaddr}"
[ -f ~/.password-store/$mwpass.gpg ] || pass insert $mwpass

echo "= manual test 1 ="


Loading…
Cancel
Save