commit 50c197ac632a35f3d8d012596f872a7854475030
parent 9c467bf4d26648baca690d81dda978ed14170cfc
Author: Luke Smith <luke@lukesmith.xyz>
Date: Thu, 19 Nov 2020 09:20:37 -0500
attachment fix; documentation fixes
Diffstat:
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/README.md b/README.md
@@ -39,7 +39,7 @@ The mutt-wizard is run with the command `mw`. Once everything is setup, you'll u
#### Providing arguments
-- `-u` -- Give an account username if different from the email address. If you use my [emailwiz](https://github.com/lukesmithxyz/emailwiz), give your username with this option. Not necessary for other accounts.
+- `-u` -- Give an account username if different from the email address.
- `-n` -- A real name to be used by the account. Put in quotations if multiple words
- `-i` -- IMAP server address
- `-I` -- IMAP server port (otherwise assumed to be 993)
@@ -65,10 +65,10 @@ There's a chance of errors if you use a slow-release distro like Ubuntu, Debian
### Optional
+- `pam-gnupg` - Automatically logs you into your GPG key on login so you will never need to input your password once logged on to your system. Check the repo and directions out [here](https://github.com/cruegge/pam-gnupg).
- `lynx` - view HTML email in neomutt.
- `notmuch` - index and search mail. Install it and run `notmuch setup`, tell it that your mail is in `~/.local/share/mail/` (although `mw` will do this automatically if you haven't set notmuch up before). You can run it in mutt with `ctrl-f`. Run `notmuch new` to process new mail.
- `abook` - a terminal-based address book. Pressing tab while typing an address to send mail to will suggest contacts that are in your abook.
-- `pam-gnupg` - this is a more general program that I use. It automatically logs you into your GPG key on login so you will never need to input your password once logged on to your system. Check the repo and directions out [here](https://github.com/cruegge/pam-gnupg).
- `urlview` - outputs urls in mail to browser.
## Neomutt user interface
@@ -88,8 +88,10 @@ To give you an example of the interface, here's an idea:
- `?` - see all keyboard shortcuts
- `ctrl-j`/`ctrl-k` - move up and down in sidebar, `ctrl-o` opens mailbox.
- `ctrl-b` - open a menu to select a url you want to open in you browser.
+-
## New stuff and improvements since the original release
+- `mw` is now scriptable with command-line options and can run successfully without any interaction, making it possible to deploy in a script.
- `isync`/`mbsync` has replaced `offlineimap` as the backend. Offlineimap was error-prone, bloated, used obsolete Python 2 modules and required separate steps to install the system.
- `mw` is now an installed program instead of just a script needed to be kept in your mutt folder.
- `dialog` is no longer used (le bloat) and the interface is simply text commands.
diff --git a/bin/mw b/bin/mw
@@ -337,7 +337,7 @@ Options allowed with -a:
-x Password for account (recommended to be in double quotes)
-p Install for a Protonmail account.
-o Configure address, but keep mail online.
- -b Assume typical English mailboxes without attempting log-on.
+ -f Assume typical English mailboxes without attempting log-on.
NOTE: Once at least one account is added, you can run
\`mbsync -a\` to begin downloading mail.
diff --git a/bin/openfile b/bin/openfile
@@ -1,9 +1,10 @@
#!/bin/sh
# Helps open a file with xdg-open from mutt in a external program without weird side effects.
-[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid xdg-open"
-mkdir -p "/tmp/$USER-mutt-tmp"
-file="/tmp/$USER-mutt-tmp/$(basename "$1")"
-rm -f "$file"
-cp "$1" "$file"
-$opener "$file" >/dev/null 2>&1 &
+tempdir="${XDG_CACHE_HOME:-$HOME/.cache}/mutt-wizard/files"
+file="$tempdir/$(basename "$1")"
+[ "$(uname)" = "Darwin" ] && opener="open" || opener="setsid -f xdg-open"
+mkdir -p "$tempdir"
+cp -f "$1" "$file"
+$opener "$file" >/dev/null 2>&1
+find "${tempdir:?}" -mtime +1 -type f -delete
diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc
@@ -4,6 +4,7 @@
# In the interest of seamless updating, do not edit this file.
# If you want to override any settings, set those in your muttrc.
set mailcap_path = /usr/local/share/mutt-wizard/mailcap
+set mime_type_query_command = "file --mime-type -b %s"
set date_format="%y/%m/%d %I:%M%p"
set index_format="%2C %Z %?X?A& ? %D %-15.15F %s (%-4.4c)"
set sort = 'reverse-date'