This commit is contained in:
Luke Smith 2019-02-21 11:39:25 -05:00
parent 5f46a1a393
commit 19c4fdb2c5
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252

44
mw
View File

@ -110,7 +110,7 @@ addaccount() { \
read -r smtp read -r smtp
printf "What is your server's SMTP port number? (Usually 587 or 465)\\n" printf "What is your server's SMTP port number? (Usually 587 or 465)\\n"
read -r sport read -r sport
printf "Great. If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github. This will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport" printf "\\nGreat! If you want to be helpful, copy the line below and you can add it to the \`domains.csv\` file on Github.\\nThis will make things easier for others who use your email provider.\\n\\n%s,%s,%s,%s,%s\\n\\nAlthough be sure to test to see if these settings work first! ;-)\\n" "$domain" "$imap" "$iport" "$smtp" "$sport"
exit exit
else else
IFS=, read service imap iport smtp sport <<EOF IFS=, read service imap iport smtp sport <<EOF
@ -221,29 +221,23 @@ detectMailboxes() { \
[ -z "$gpgemail" ] && askgpg [ -z "$gpgemail" ] && askgpg
while : ; main() { \
do while : ; do
choice=$(dialog --title "Luke's mutt/offlineIMAP wizard" --nocancel \ printf "What would you like mutt-wizard to do?
--menu "What would you like to do?" 15 50 8 \ 1 Add an email account
0 "Add email account (Begin installtion)" \ 2 Autodetect mailboxes
1 "Autodetect mailboxes (Finalize installation)" \ 3 Change an account's password
2 "Enable/disable autosync." \ 0 Exit
3 "Change an account's password" \ Input a number to continue or press ctrl-c.\\n"
4 "Remove an account" \ read -r choice
5 "Remove all accounts" \ case "$choice" in
6 "Change your GPG email" \ 1) addaccount ;;
7 "Exit this wizard." \ 0) break ;;
3>&1 1>&2 2>&3 3>&1 ) *) printf "Invalid input.\\n"
esac
case $choice in
0) addaccount ;;
1) detectWarning && chooseDetect;;
3) inventory && for i in $userchoices; do getpass "$i" ; done;;
4) inventory && for i in $userchoices; do removeAccount "$i" ; done;;
5) (dialog --defaultno --title "Wipe all custom neomutt/offlineIMAP settings?" --yesno "Would you like to wipe all of the mutt/offlineIMAP settings generated by the system?" 6 60 && wipe) ;;
6) askgpg ;;
7) clear && break ;;
*) echo "Error. Are you sure you have dialog installed?" >&2; exit 2
esac
done done
}
main
rm -rf "$tmpdir" rm -rf "$tmpdir"