print "DONE\\nShredding all memory of your password for safety's sake..."
printf "DONE\\nShredding all memory of your password for safety's sake..."
unset password
unset password
shred -u "$tmpdir/$1" | rm -f "$tmpdir/$1"
mv "$tmpdir/$1.gpg" "$creddir"
shred -u "$tmpdir/$1" #| rm -f "$tmpdir/$1"
mkdir -p "$creddir"
mv "$tmpdir/$1.gpg" "$creddir/"
printf "DONE.\\n"
printf "DONE.\\n"
}
}
@@ -174,6 +177,7 @@ askgpg() { \
read -r gpgemail
read -r gpgemail
done
done
if "$GPG" -K | grep "<$gpgemail>" >/dev/null; then
if "$GPG" -K | grep "<$gpgemail>" >/dev/null; then
mkdir -p "$creddir"
echo "$gpgemail" > "$creddir/gpgemail"
echo "$gpgemail" > "$creddir/gpgemail"
else
else
printf "You do not appear to have a private key associated with %s.\\nPlease generate a GPG key pair by running \`%s --full-gen-key\` and rerun the wizard.\\n" "$gpgemail" "$GPG"
printf "You do not appear to have a private key associated with %s.\\nPlease generate a GPG key pair by running \`%s --full-gen-key\` and rerun the wizard.\\n" "$gpgemail" "$GPG"
@@ -196,73 +200,73 @@ gen_delim() { \
echo $delim ;}
echo $delim ;}
trysync() { \
trysync() { \
! ping -q -c 1 1.1.1.1 > /dev/null && printf "No internet connection detected.\\nTry rerunning offlineimap manually when connection is established, then select the option to detect mailboxes and finalize installation.\\n" && exit 1
! ping -q -c 1 1.1.1.1 > /dev/null && printf "No internet connection detected.\\nTry rerunning offlineimap manually when connection is established, then select the option to detect mailboxes and finalize installation.\\n" && return 1
printf "mutt-wizard will run offlineimap briefly to (1) ensure that login details are functional and (2) allow offlineimap to tell us what mailboxes your email account has.\\nAfter around 15 seconds, mutt-wizard will kill the process and continue.\\nYou can run offlineimap manually to finish the mail sync later.\\nPress enter to continue.\\n."
printf "mutt-wizard will run offlineimap briefly to (1) ensure that login details are functional and (2) allow offlineimap to tell us what mailboxes your email account has.\\nAfter around 15 seconds, mutt-wizard will kill the process and continue.\\nYou can run offlineimap manually to finish the mail sync later.\\nPress enter to continue.\\n."
printf "\033[31m\033[31mSync not successful.\033[0m Try running offlineimap manually after double-checking your password and server settings.\\nThen select to finalize the account.\\n"; exit 1
printf "\033[31m\033[31mSync not successful.\033[0m Try running offlineimap manually after double-checking your password and server settings.\\nThen select to finalize the account.\\n"; return 1
fi
fi
}
}
finalize() { \
finalize() { \
boxes="$(ls -d "$maildir/$title/"* 2>/dev/null | sed "s/.*\///;s/^/=/")"
boxes="$(ls -d "$maildir/$title/"* 2>/dev/null | sed "s/.*\///;s/^/=/")"
[ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that offlineimap has not been successfully run.\\nRun offlineimap, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && exit
echo "$boxes" > "$tmpdir/$title_boxes"
[ -z "$boxes" ] && printf "\033[31mNo local mailboxes have been detected for %s.\033[0m\\nThis means that offlineimap has not been successfully run.\\nRun offlineimap, and if it has an error, be sure to check your password and server settings manually if needbe.\\n" "$title" && return