| @@ -13,7 +13,6 @@ pass_prefix="mw-" | |||||
| muttdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt" # Main mutt config location | muttdir="${XDG_CONFIG_HOME:-$HOME/.config}/mutt" # Main mutt config location | ||||
| accdir="$muttdir/accounts" # Directory for account settings | accdir="$muttdir/accounts" # Directory for account settings | ||||
| maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage | maildir="${XDG_DATA_HOME:-$HOME/.local/share}/mail" # Location of mail storage | ||||
| 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/.mbsyncrc}" | mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" | ||||
| @@ -228,7 +227,7 @@ Trash | |||||
| Sent | Sent | ||||
| Archive" && return 0 | Archive" && return 0 | ||||
| if mailboxes="$(mbsync -l "$fulladdr" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then | if mailboxes="$(mbsync -l "$fulladdr" | sed 's/\//./')" >/dev/null 2>&1 && [ -n "$mailboxes" ]; then | ||||
| [ "$accounttype" = "online" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu | |||||
| [ -n "${online+x}" ] && sed -ibu "/IMAPStore $fulladdr-remote$/,/# End profile/d" "$mbsyncrc" ; rm -f "$mbsyncrc"bu | |||||
| return 0 | return 0 | ||||
| else | else | ||||
| echo "$mailboxes" | echo "$mailboxes" | ||||
| @@ -290,7 +289,7 @@ setact() { if [ -n "${action+x}" ] && [ "$action" != "$1" ]; then | |||||
| trap 'echo -e "\033[0m\n"; exit' INT ABRT | trap 'echo -e "\033[0m\n"; exit' INT ABRT | ||||
| while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in | |||||
| while getopts "fplhodYD:y:i:I:s:S:u:a:n:x:m:" o; do case "${o}" in | |||||
| l) setact list || exit 1 ;; | l) setact list || exit 1 ;; | ||||
| d) setact delete || exit 1 ;; | d) setact delete || exit 1 ;; | ||||
| D) setact delete || exit 1 ; fulladdr="$OPTARG" ;; | D) setact delete || exit 1 ; fulladdr="$OPTARG" ;; | ||||
| @@ -308,7 +307,6 @@ while getopts "fplhdYD:y:i:I:s:S:u:a:n:x:" o; do case "${o}" in | |||||
| f) setact add || exit 1 ; force=True ;; | f) setact add || exit 1 ; force=True ;; | ||||
| x) setact add || exit 1 ; password="$OPTARG" ;; | x) setact add || exit 1 ; password="$OPTARG" ;; | ||||
| p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." | p) echo "NOTE: Protonmail users must install and configure Protonmail Bridge first for the first sync to work." | ||||
| proton=True | |||||
| imap="127.0.0.1" | imap="127.0.0.1" | ||||
| iport="1143" | iport="1143" | ||||
| smtp="127.0.0.1" | smtp="127.0.0.1" | ||||