From 234be769e84da9b56181229b18d7dfbe5ac3a0ac Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 13 Feb 2023 15:54:16 -0500 Subject: [PATCH] deprecate -y and -Y, cleanup. --- README.md | 5 +++-- bin/mw | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index cb5a5d9..9db681f 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,7 @@ Specifically, this wizard: - `isync` - downloads and syncs the mail (required if storing IMAP mail locally). - `msmtp` - sends the email. - `pass` - safely encrypts passwords (required at install). +- `ca-certificates` - required for SSL. Probably installed already. **Note**: There's a chance of errors if you use a slow-release distro like Ubuntu, Debian, or Mint. If you get errors in `neomutt`, install the most @@ -75,14 +76,14 @@ The mutt-wizard runs via the command `mw`. Once setup is complete, you'll use - `mw -a you@email.com` -- add a new email account - `mw -l` -- list existing accounts -- `mw -y your@email.com` -- sync an email account -- `mw -Y` -- sync all configured email accounts - `mw -d` -- choose an account to delete - `mw -D your@email.com` -- delete account settings without confirmation - `mw -t 30` -- toggle automatic mailsync to every 30 minutes - `mw -T` -- toggle mailsync without specifying minutes (default is 10) - `mw -r` -- reorder account shortcut numbers - `pass edit mw-your@email.com` -- revise an account's password +- `mailsync` -- sync all configured email accounts. Also gives notifications of new mail and indexes new mail with notmuch silently. +- `mailsync your@email.com` -- sync a particular (or several) email account(s). ### Options usable when adding an account diff --git a/bin/mw b/bin/mw index 96cf327..642687d 100755 --- a/bin/mw +++ b/bin/mw @@ -12,7 +12,8 @@ mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}" mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config" alias mbsync='mbsync -c "$mbsyncrc"' -# On Ubuntu/Debian, a link is needed since they use an older version. +# mbsync now requires "Far/Near" rather than "Master/Slave", but Ubuntu/Debian +# have the older version. if command -V apt-get >/dev/null 2>&1; then master="Master" slave="Slave" @@ -98,7 +99,7 @@ set realname = \"$realname\" set from = \"$fulladdr\" set sendmail = \"msmtp -a $fulladdr\" alias me $realname <$fulladdr> -set folder = \"$folder\" +set folder = \"${folder:-$maildir/$fulladdr}\" set header_cache = $cachedir/$fulladdr/headers set message_cachedir = $cachedir/$fulladdr/bodies set mbox_type = Maildir @@ -110,6 +111,7 @@ set trash = "+Trash" set record = "+Sent" $extra $synccmd +macro index o \"mailsync $fulladdr\" \"sync $fulladdr\" macro index \eg \"unset wait_keygpg --list-secret-keys; printf 'Enter email ID of user to publish: '; read eID; printf 'Enter fingerprint of GPG key to publish: '; read eFGPT; $prefix/libexec/gpg-wks-client --create \\\$eFGPT \\\$eID | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"publish GPG key to WKS provider\" macro index \eh \"$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr\" \"confirm GPG publication\" " > "$accdir/$fulladdr.muttrc" @@ -132,12 +134,8 @@ set imap_pass = \"\`pass $passprefix$fulladdr\`\" set ssl_starttls = yes set ssl_force_tls = yes" ;; - pop) synccmd="macro index o \"mpop $fulladdr\" \"run mpop to get $fulladdr's mail\"" - folder="$maildir/$fulladdr" - prepmpop ;; - *) synccmd="macro index o \"mw -y $fulladdr\" \"run mbsync to sync $fulladdr\"" - folder="$maildir/$fulladdr" - prepmbsync ;; + pop) prepmpop ;; + *) prepmbsync ;; esac prepmsmtp prepmutt @@ -379,7 +377,10 @@ case "$action" in list) list ;; add) checkbasics && askinfo && getboxes && getprofiles && finalize ;; delete) delete ;; - sync) mailsync $fulladdr ;; + sync) + echo "\`mw -y\` and \`mw -Y\` are now deprecated and will be removed in a future update. Please switch to using \`mailsync\`." + mailsync $fulladdr + ;; toggle) togglecron ;; reorder) reorder ;; *) mwinfo; exit 1 ;;