Browse Source

deprecate -y and -Y, cleanup.

pull/908/head
Luke Smith 1 year ago
parent
commit
234be769e8
No known key found for this signature in database GPG Key ID: 4C50B54A911F6252
2 changed files with 13 additions and 11 deletions
  1. +3
    -2
      README.md
  2. +10
    -9
      bin/mw

+ 3
- 2
README.md View File

@@ -35,6 +35,7 @@ Specifically, this wizard:
- `isync` - downloads and syncs the mail (required if storing IMAP mail locally). - `isync` - downloads and syncs the mail (required if storing IMAP mail locally).
- `msmtp` - sends the email. - `msmtp` - sends the email.
- `pass` - safely encrypts passwords (required at install). - `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 **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 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 -a you@email.com` -- add a new email account
- `mw -l` -- list existing accounts - `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` -- choose an account to delete
- `mw -D your@email.com` -- delete account settings without confirmation - `mw -D your@email.com` -- delete account settings without confirmation
- `mw -t 30` -- toggle automatic mailsync to every 30 minutes - `mw -t 30` -- toggle automatic mailsync to every 30 minutes
- `mw -T` -- toggle mailsync without specifying minutes (default is 10) - `mw -T` -- toggle mailsync without specifying minutes (default is 10)
- `mw -r` -- reorder account shortcut numbers - `mw -r` -- reorder account shortcut numbers
- `pass edit mw-your@email.com` -- revise an account's password - `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 ### Options usable when adding an account




+ 10
- 9
bin/mw View File

@@ -12,7 +12,8 @@ mbsyncrc="${MBSYNCRC:-$HOME/.mbsyncrc}"
mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config" mpoprc="${XDG_CONFIG_HOME:-$HOME/.config}/mpop/config"
alias mbsync='mbsync -c "$mbsyncrc"' 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 if command -V apt-get >/dev/null 2>&1; then
master="Master" master="Master"
slave="Slave" slave="Slave"
@@ -98,7 +99,7 @@ set realname = \"$realname\"
set from = \"$fulladdr\" set from = \"$fulladdr\"
set sendmail = \"msmtp -a $fulladdr\" set sendmail = \"msmtp -a $fulladdr\"
alias me $realname <$fulladdr> alias me $realname <$fulladdr>
set folder = \"$folder\"
set folder = \"${folder:-$maildir/$fulladdr}\"
set header_cache = $cachedir/$fulladdr/headers set header_cache = $cachedir/$fulladdr/headers
set message_cachedir = $cachedir/$fulladdr/bodies set message_cachedir = $cachedir/$fulladdr/bodies
set mbox_type = Maildir set mbox_type = Maildir
@@ -110,6 +111,7 @@ set trash = "+Trash"
set record = "+Sent" set record = "+Sent"
$extra $extra
$synccmd $synccmd
macro index o \"<shell-escape>mailsync $fulladdr<enter>\" \"sync $fulladdr\"
macro index \eg \"<enter-command>unset wait_key<enter><shell-escape>gpg --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<enter>\" \"publish GPG key to WKS provider\" macro index \eg \"<enter-command>unset wait_key<enter><shell-escape>gpg --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<enter>\" \"publish GPG key to WKS provider\"
macro index \eh \"<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>\" \"confirm GPG publication\" macro index \eh \"<pipe-message>$prefix/libexec/gpg-wks-client --receive | msmtp --read-envelope-from --read-recipients -a $fulladdr<enter>\" \"confirm GPG publication\"
" > "$accdir/$fulladdr.muttrc" " > "$accdir/$fulladdr.muttrc"
@@ -132,12 +134,8 @@ set imap_pass = \"\`pass $passprefix$fulladdr\`\"
set ssl_starttls = yes set ssl_starttls = yes
set ssl_force_tls = yes" set ssl_force_tls = yes"
;; ;;
pop) synccmd="macro index o \"<shell-escape>mpop $fulladdr<enter>\" \"run mpop to get $fulladdr's mail\""
folder="$maildir/$fulladdr"
prepmpop ;;
*) synccmd="macro index o \"<shell-escape>mw -y $fulladdr<enter>\" \"run mbsync to sync $fulladdr\""
folder="$maildir/$fulladdr"
prepmbsync ;;
pop) prepmpop ;;
*) prepmbsync ;;
esac esac
prepmsmtp prepmsmtp
prepmutt prepmutt
@@ -379,7 +377,10 @@ case "$action" in
list) list ;; list) list ;;
add) checkbasics && askinfo && getboxes && getprofiles && finalize ;; add) checkbasics && askinfo && getboxes && getprofiles && finalize ;;
delete) delete ;; 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 ;; toggle) togglecron ;;
reorder) reorder ;; reorder) reorder ;;
*) mwinfo; exit 1 ;; *) mwinfo; exit 1 ;;


Loading…
Cancel
Save