| @@ -16,11 +16,12 @@ maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage | |||||
| namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username | namere="^[a-z_][a-z0-9_-]*$" # Regex to ensure viable username | ||||
| emailre=".+@.+\..+" # Regex to confirm valid email address | emailre=".+@.+\..+" # Regex to confirm valid email address | ||||
| muttshare="$prefix/share/mutt-wizard" | muttshare="$prefix/share/mutt-wizard" | ||||
| mbsyncrc="${MBSYNCRC_HOME:-$HOME/.mbsyncrc}" | |||||
| mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" | |||||
| mwconfig="$muttshare/mutt-wizard.muttrc" | mwconfig="$muttshare/mutt-wizard.muttrc" | ||||
| cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" | cachedir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard" | ||||
| muttrc="$muttdir/muttrc" | muttrc="$muttdir/muttrc" | ||||
| msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" | msmtprc="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/config" | ||||
| msmtplog="${XDG_CONFIG_HOME:-$HOME/.config}/msmtp/msmtp.log" | |||||
| ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail | ssltype="IMAPS" # This is later changed to `None` later in the script if using Protonmail | ||||
| alias mbsync='mbsync -c "$mbsyncrc"' | alias mbsync='mbsync -c "$mbsyncrc"' | ||||
| @@ -39,7 +40,7 @@ msmtp_header="defaults | |||||
| auth on | auth on | ||||
| tls on | tls on | ||||
| tls_trust_file $sslcert | tls_trust_file $sslcert | ||||
| logfile ${XDG_CONFIG_HOME/:-$HOME/.config}/msmtp/msmtp.log | |||||
| logfile $msmtplog | |||||
| " | " | ||||
| msmtp_profile="account $title | msmtp_profile="account $title | ||||
| host $smtp | host $smtp | ||||
| @@ -328,7 +329,7 @@ case "$1" in | |||||
| add) asktype && askinfo && tryconnect && finalize || delete ;; | add) asktype && askinfo && tryconnect && finalize || delete ;; | ||||
| pass) pick "change the password of" && getpass ;; | pass) pick "change the password of" && getpass ;; | ||||
| delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; | delete) pick delete && confirm "delete the \`$title\` profile" && delete ;; | ||||
| sync) syncwrapper $2 ;; | |||||
| sync) syncwrapper "$2" ;; | |||||
| purge) purge ;; | purge) purge ;; | ||||
| *) cat << EOF | *) cat << EOF | ||||
| mw: mutt-wizard, auto-configure email accounts for mutt | mw: mutt-wizard, auto-configure email accounts for mutt | ||||