From aece24c7ddb058589273e5e0b7cc89b70d6a54e1 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 27 Aug 2020 16:38:14 -0400 Subject: revert auto gpg to fix #491 #484 #493 etc --- share/mutt-wizard.muttrc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index aafb3d5..e7fa8c8 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -63,6 +63,11 @@ bind pager \031 previous-line # Mouse wheel bind pager \005 next-line # Mouse wheel bind editor complete-query +#set crypt_autosign = yes +#set crypt_opportunistic_encrypt = yes +#set pgp_self_encrypt = yes +#set pgp_default_key = 'your@gpgemailaddre.ss' + macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" macro index O "mbsync -a" "run mbsync to sync all mail" -- cgit v1.2.3 From 032077adf6a7f7d56b48df5c4f879b207155dd55 Mon Sep 17 00:00:00 2001 From: "A. Tammy" Date: Sun, 6 Sep 2020 15:58:53 -0400 Subject: fix notmuch integration caller command (#520) Co-authored-by: Aisha Tammy --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index e7fa8c8..c3dae24 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -71,7 +71,7 @@ bind editor complete-query macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" macro index O "mbsync -a" "run mbsync to sync all mail" -macro index \Cf "unset wait_keyread -p 'Enter a search term to find with notmuch: ' x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index \Cf "unset wait_keyread x?'Enter a search term to find with notmuch: '; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" # Sidebar mappings -- cgit v1.2.3 From 9cd26a24959ac339f44b6cde6195116a9f1e6656 Mon Sep 17 00:00:00 2001 From: f380cedric Date: Mon, 5 Oct 2020 11:30:58 +0200 Subject: Use POSIX-compliant read Rewrite #520. Using `read var?'prompt'` is wrong. It is ksh (and zsh) specific. Using `read -p 'prompt' var` is also wrong. It is bash specific. Since we cannot assume which sh is implemented, we should write POSIX-compliant code. --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index c3dae24..57df579 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -71,7 +71,7 @@ bind editor complete-query macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" macro index O "mbsync -a" "run mbsync to sync all mail" -macro index \Cf "unset wait_keyread x?'Enter a search term to find with notmuch: '; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" +macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" # Sidebar mappings -- cgit v1.2.3 From c08cfd53654bb3046502955c93399861b487c760 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sun, 11 Oct 2020 19:29:34 -0400 Subject: more --- bin/mw | 50 ++++++++++-------------------------------------- share/mutt-wizard.muttrc | 2 +- 2 files changed, 11 insertions(+), 41 deletions(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/bin/mw b/bin/mw index 387747a..6f4448f 100755 --- a/bin/mw +++ b/bin/mw @@ -94,7 +94,7 @@ bind index,pager g noop bind index,pager M noop bind index,pager C noop bind index gg first-entry -macro index o \"mbsync -V $fulladdr\" \"run mbsync to sync $fulladdr\" +macro index o \"mw -y $fulladdr\" \"run mbsync to sync $fulladdr\" unmailboxes * " else @@ -182,42 +182,31 @@ askinfo() { \ } -writeinfo() { - # Insert account information into variables. - getprofiles - - # Create required directories. - mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" +writeinfo() { mkdir -p "$muttdir" "$accdir" "$cachedir/$fulladdr/bodies" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$maildir/$fulladdr" # Get accounts and find the first missing account number (max. 9). getaccounts for x in $(seq 1 9); do echo "$accounts" | grep -q "$x" || { export idnum="$x"; break ;}; done - # Create msmtprc file if not present. + # Configure msmtprc for sending mail. [ ! -f "$msmtprc" ] && echo "$msmtp_header" > "$msmtprc" - - # Add account msmtp settings. echo "$msmtp_profile" >> "$msmtprc" - # On Ubuntu/Debian, a link is needed since they use an older version. command -V apt-get >/dev/null 2>&1 && ln -s "$msmtprc" "$HOME/.msmtprc" 2>/dev/null - # Create the individual mutt config file for the account. - echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" - # Create the mbsync config file. mkdir -p "${mbsyncrc%/*}" echo "$mbsync_profile" >> "$mbsyncrc" - # Create a notmuch config file if not present already. - notmuchauto - - # Create a basic muttrc is not present and source the mutt-wizard files - # and add the shortcuts to the account. - [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" && echo "muttrc created." + # Create a muttrc for viewing mail. + echo "$mutt_profile" > "$accdir/$idnum-$fulladdr.muttrc" + [ ! -f "$muttrc" ] && echo "# vim: filetype=neomuttrc" > "$muttrc" ! grep -q "^source.*mutt-wizard.muttrc" "$muttrc" && echo "source $mwconfig $MARKER" >> "$muttrc" ! grep "^source.*.muttrc" "$muttrc" | grep -qv "$mwconfig" && echo "source $accdir/$idnum-$fulladdr.muttrc $MARKER" >> "$muttrc" echo "macro index,pager i$idnum 'source $accdir/$idnum-$fulladdr.muttrc!;' \"switch to $fulladdr\" $MARKER" >> "$muttrc" + + # Create a notmuch config file if not present already. + notmuchauto } protonfinger() { printf "Getting Protonmail bridge fingerprint...\\n" @@ -269,30 +258,12 @@ finalize() { echo "$mailboxes" | xargs -I {} mkdir -p "$maildir/$fulladdr/{}/cur command -V urlview >/dev/null 2>&1 && [ ! -f "$HOME/.urlview" ] && echo "COMMAND \$BROWSER" > "$HOME/.urlview" return 0 ;} -confirm() { printf "Do you want to %s? [yes/N]\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 - printf "Are you really, really sure you want to %s?\\n\t" "$@" && read -r input && ! echo "$input" | grep -qi "^yes$" && printf "That doesn't seem like a yes to me.\\n\\n" && return 1 - return 0 ;} - -pick() { [ -n "${fulladdr+x}" ] && return 0 - echo "Select the account your would like to $1 (by number):" - list - read -r input - fulladdr="$(echo "$accounts" | grep "^$input:" | cut -f2 -d' ')" - [ -z "$fulladdr" ] && echo "Invalid response." && return 1 - return 0 ;} - syncwrapper() { mbsync "${1:--a}" & ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null wait ( kill -46 "$(pidof "${STATUSBAR:-dwmblocks}")" >/dev/null 2>&1 ) 2>/dev/null notmuch new ;} -purge() { confirm "delete all account data" || exit - rm -rf "$mbsyncrc" "$accdir" "${XDG_CONFIG_HOME:-$HOME/.config}/msmtp" "$cachedir" - echo "All configs and account settings have been purged." - sed -ibu "/$MARKER/d" "$muttrc" ; rm -f "$muttrc"bu -} - notmuchauto() { \ [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" [ -f "$NOTMUCH_CONFIG" ] && return 0 @@ -384,8 +355,7 @@ esac done case "$action" in list) list ;; - add) askinfo && writeinfo && getboxes && finalize || delete ;; + add) askinfo && getprofiles && writeinfo && getboxes && finalize || delete ;; delete) delete $fulladdr ;; sync) syncwrapper $fulladdr ;; - purge) purge ;; esac diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 57df579..de169db 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -80,7 +80,7 @@ set sidebar_width = 20 set sidebar_short_path = yes set sidebar_next_new_wrap = yes set mail_check_stats -set sidebar_format = '%B%?F? [%F]?%* %?N?%N/? %?S?%S?' +set sidebar_format = '%D%?F? [%F]?%* %?N?%N/? %?S?%S?' bind index,pager \Ck sidebar-prev bind index,pager \Cj sidebar-next bind index,pager \Co sidebar-open -- cgit v1.2.3 From e7180e1b570532c18613106c5786c1172d22831b Mon Sep 17 00:00:00 2001 From: Yiqun Ding Date: Wed, 28 Oct 2020 11:25:51 +0800 Subject: fix macro for sync all accounts the macro for sync all accounts uses 'mbsync -a' command, which failed to run for users who have moved their ~/.mbsyncrc somewhere else. we should use mw -Y instead, which can detect the MBSYNCRC env --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index de169db..ac4883e 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -70,7 +70,7 @@ bind editor complete-query macro index,pager a "set my_pipe_decode=\$pipe_decode pipe_decodeabook --add-emailset pipe_decode=\$my_pipe_decode; unset my_pipe_decode" "add the sender address to abook" macro index \Cr "T~UN." "mark all messages as read" -macro index O "mbsync -a" "run mbsync to sync all mail" +macro index O "mw -Y" "run mw -Y to sync all mail" macro index \Cf "unset wait_keyprintf 'Enter a search term to find with notmuch: '; read x; echo \$x >~/.cache/mutt_terms~i \"\`notmuch search --output=messages \$(cat ~/.cache/mutt_terms) | head -n 600 | perl -le '@a=<>;s/\^id:// for@a;$,=\"|\";print@a' | perl -le '@a=<>; chomp@a; s/\\+/\\\\+/ for@a;print@a' \`\"" "show only messages matching a notmuch pattern" macro index A "all\n" "show all messages (undo limit)" -- cgit v1.2.3 From ab11cd83229325b8b86d4ed46d5b7b1b4795b460 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Wed, 28 Oct 2020 10:26:15 -0400 Subject: suppress autoview messages --- share/mutt-wizard.muttrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index de169db..a7aa26a 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -22,8 +22,9 @@ set forward_quote # include message in forwards set reverse_name # reply as whomever it was to set include # include message in replies set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) -auto_view text/html # automatically show html (mailcap uses w3m) +auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted +set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html bind index,pager i noop bind index,pager g noop -- cgit v1.2.3 From 50c197ac632a35f3d8d012596f872a7854475030 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 19 Nov 2020 09:20:37 -0500 Subject: attachment fix; documentation fixes --- README.md | 6 ++++-- bin/mw | 2 +- bin/openfile | 13 +++++++------ share/mutt-wizard.muttrc | 1 + 4 files changed, 13 insertions(+), 9 deletions(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/README.md b/README.md index 1027555..31118f1 100644 --- 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 index af4d785..9385bf5 100755 --- 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 index f6668dc..cf3c6c3 100755 --- 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 index 94401e8..f40063d 100644 --- 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' -- cgit v1.2.3 From 59322fb546479f51045752e74c966b96d847cb81 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 23 Nov 2020 17:45:56 -0500 Subject: remove tac line until further fix cloeses #577 #572 --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index f40063d..a9484f3 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -25,7 +25,7 @@ set include # include message in replies set mail_check=60 # to avoid lags using IMAP with some email providers (yahoo for example) auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted -set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. +#set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html bind index,pager i noop bind index,pager g noop -- cgit v1.2.3 From c8f2aa2c529464306decbc2e21f1702d4bd9ae17 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 7 Jan 2021 17:38:40 -0500 Subject: close #566 --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index a9484f3..2cb7c8e 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -3,7 +3,7 @@ # mutt-wizard will have this file sourced from your muttrc. # 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 mailcap_path = /usr/local/share/mutt-wizard/mailcap:$mailcap_path 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)" -- cgit v1.2.3 From bd0075898ae441bb5e59f83d8b34df68b55aafb3 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Thu, 23 Sep 2021 22:18:54 -0400 Subject: hardcode mailbox names. don't remake shortcuts. --- Makefile | 4 ++-- bin/mailsync | 2 +- bin/mw | 34 +++++++--------------------------- share/mutt-wizard.muttrc | 23 +++++++++++++++++++++++ share/switch.muttrc | 10 ++++++++++ share/unbind.muttrc | 37 ------------------------------------- 6 files changed, 43 insertions(+), 67 deletions(-) create mode 100644 share/switch.muttrc delete mode 100644 share/unbind.muttrc (limited to 'share/mutt-wizard.muttrc') diff --git a/Makefile b/Makefile index 64036d0..03e2df1 100644 --- a/Makefile +++ b/Makefile @@ -14,8 +14,8 @@ install: chmod 755 $(DESTDIR)$(PREFIX)/bin/mw $(DESTDIR)$(PREFIX)/bin/mailsync $(DESTDIR)$(PREFIX)/bin/openfile mkdir -p $(DESTDIR)$(PREFIX)/share/mutt-wizard chmod 755 $(DESTDIR)$(PREFIX)/share/mutt-wizard - cp -f share/mailcap share/domains.csv share/mutt-wizard.muttrc share/unbind.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard - chmod 644 $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap $(DESTDIR)$(PREFIX)/share/mutt-wizard/domains.csv $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard/unbind.muttrc + cp -f share/mailcap share/domains.csv share/mutt-wizard.muttrc share/switch.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard + chmod 644 $(DESTDIR)$(PREFIX)/share/mutt-wizard/mailcap $(DESTDIR)$(PREFIX)/share/mutt-wizard/domains.csv $(DESTDIR)$(PREFIX)/share/mutt-wizard/mutt-wizard.muttrc $(DESTDIR)$(PREFIX)/share/mutt-wizard/switch.muttrc mkdir -p $(DESTDIR)$(MANPREFIX)/man1 cp -f mw.1 $(DESTDIR)$(MANPREFIX)/man1/mw.1 chmod 644 $(DESTDIR)$(MANPREFIX)/man1/mw.1 diff --git a/bin/mailsync b/bin/mailsync index 9490458..36f963b 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -36,7 +36,7 @@ case "$(uname)" in ;; *) case "$(readlink -f /sbin/init)" in - *systemd*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; + *systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; esac # remember if a display server is running since `ps` doesn't always contain a display pgrepoutput="$(pgrep -a X\(org\|wayland\))" diff --git a/bin/mw b/bin/mw index 01bf86b..16df7d3 100755 --- a/bin/mw +++ b/bin/mw @@ -101,7 +101,11 @@ set header_cache = $cachedir/$fulladdr/headers set message_cachedir = $cachedir/$fulladdr/bodies set mbox_type = Maildir set hostname = \"$hostname\" -source $muttshare/unbind.muttrc +source $muttshare/switch.muttrc +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set trash = "+Trash" +set record = "+Sent" $extra $synccmd " > "$accdir/$fulladdr.muttrc" @@ -135,7 +139,6 @@ set ssl_force_tls = yes" esac prepmsmtp prepmutt - prepnotmuch # Create a notmuch config file if not present already. } @@ -211,14 +214,6 @@ createpass() { echo "$password" > "$PASSWORD_STORE_DIR/$fulladdr" getpass() { while : ; do pass rm -f "$fulladdr" >/dev/null 2>&1 pass insert -f "$fulladdr" && break; done ;} -formatShortcut() { toappend="$toappend -macro index,pager g$1 \"=$3\" \"go to $2\" -macro index,pager M$1 \";=$3\" \"move mail to $2\" -macro index,pager C$1 \";=$3\" \"copy mail to $2\"" ;} - -setBox() { toappend="$toappend -set $1 = \"+$2\"" ;} - getboxes() { if [ -n "${force+x}" ] ; then mailboxes="$(printf "INBOX\\nDrafts\\nJunk\\nTrash\\nSent\\nArchive")" else @@ -232,20 +227,6 @@ getboxes() { if [ -n "${force+x}" ] ; then [ $idnum -eq $x ] || break done toappend="mailboxes \`mdir=$maildir/$fulladdr/; find \$mdir -mindepth 1 -type d -name cur | sed -e 's:/cur\$:\":' -e \"s:\$mdir:\\\"=:\" | sort | tr '\\\n' ' '\`" - IFS=' -' - for x in $mailboxes; do - case "$x" in - *[Ss][Ee][Nn][Tt]*) setBox record "$x"; formatShortcut s sent "$x" ;; - *[Dd][Rr][Aa][Ff][Tt][Ss]*) setBox postponed "$x"; formatShortcut d drafts "$x" ;; - *[Tt][Rr][Aa][Ss][Hh]*) formatShortcut t trash "$x"; setBox trash "$x" ;; - *[Jj][Uu][Nn][Kk]*) formatShortcut j junk "$x" ;; - *[Aa][Rr][Cc][Hh][Ii][Vv][Ee]*) formatShortcut a archive "$x" ;; - *[Ss][Pp][Aa][Mm]*) formatShortcut S spam "$x" ;; - *[Ii][Nn][Bb][Oo][Xx]) formatShortcut i inbox "$x"; setBox spoolfile "$x" inbox="$x" ;; - esac - done - unset IFS } finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc" @@ -257,7 +238,7 @@ finalize() { echo "$toappend" >> "$accdir/$fulladdr.muttrc" prepnotmuch() { \ [ -z "$NOTMUCH_CONFIG" ] && NOTMUCH_CONFIG="$HOME/.notmuch-config" [ -f "$NOTMUCH_CONFIG" ] && return 0 - nmbasic="[database] + echo "[database] path=$maildir [user] name=$realname @@ -270,8 +251,7 @@ exclude_tags=deleted;spam; [maildir] synchronize_flags=true [crypto] -gpg_path=$GPG" - echo "$nmbasic" > "$NOTMUCH_CONFIG" ;} +gpg_path=$GPG" > "$NOTMUCH_CONFIG" ;} togglecron() { cron="$(mktemp)" crontab -l > "$cron" diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 2cb7c8e..a12a77e 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -27,11 +27,15 @@ auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted #set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html + bind index,pager i noop bind index,pager g noop bind index \Cf noop +bind index,pager M noop +bind index,pager C noop # General rebindings +bind index gg first-entry bind index j next-entry bind index k previous-entry bind attach view-mailcap @@ -65,6 +69,25 @@ bind pager \031 previous-line # Mouse wheel bind pager \005 next-line # Mouse wheel bind editor complete-query +macro index,pager gi "=INBOX" "go to inbox" +macro index,pager Mi ";=INBOX" "move mail to inbox" +macro index,pager Ci ";=INBOX" "copy mail to inbox" +macro index,pager gd "=Drafts" "go to drafts" +macro index,pager Md ";=Drafts" "move mail to drafts" +macro index,pager Cd ";=Drafts" "copy mail to drafts" +macro index,pager gj "=Junk" "go to junk" +macro index,pager Mj ";=Junk" "move mail to junk" +macro index,pager Cj ";=Junk" "copy mail to junk" +macro index,pager gt "=Trash" "go to trash" +macro index,pager Mt ";=Trash" "move mail to trash" +macro index,pager Ct ";=Trash" "copy mail to trash" +macro index,pager gs "=Sent" "go to sent" +macro index,pager Ms ";=Sent" "move mail to sent" +macro index,pager Cs ";=Sent" "copy mail to sent" +macro index,pager ga "=Archive" "go to archive" +macro index,pager Ma ";=Archive" "move mail to archive" +macro index,pager Ca ";=Archive" "copy mail to archive" + #set crypt_autosign = yes #set crypt_opportunistic_encrypt = yes #set pgp_self_encrypt = yes diff --git a/share/switch.muttrc b/share/switch.muttrc new file mode 100644 index 0000000..c808c99 --- /dev/null +++ b/share/switch.muttrc @@ -0,0 +1,10 @@ +# vim: filetype=neomuttrc + +# This is an embarrassing and hacky file that unbinds a bunch of binds between +# switching accounts. It is called each time an account is changed. + +unset hostname +unmy_hdr Organization +unmailboxes * +unalternates * +unset signature diff --git a/share/unbind.muttrc b/share/unbind.muttrc deleted file mode 100644 index 330d823..0000000 --- a/share/unbind.muttrc +++ /dev/null @@ -1,37 +0,0 @@ -# vim: filetype=neomuttrc - -# This is an embarrassing and hacky file that unbinds a bunch of binds between -# switching accounts. It is called each time an account is changed. - -bind index,pager gi noop -bind index,pager gs noop -bind index,pager gd noop -bind index,pager ga noop -bind index,pager gS noop -bind index,pager gj noop -bind index,pager gt noop -bind index,pager Mi noop -bind index,pager Ms noop -bind index,pager Md noop -bind index,pager Ma noop -bind index,pager MS noop -bind index,pager Mj noop -bind index,pager Mt noop -bind index,pager Ci noop -bind index,pager Cs noop -bind index,pager Cd noop -bind index,pager Ca noop -bind index,pager CS noop -bind index,pager Cj noop -bind index,pager Ct noop -bind index,pager gg noop -bind index,pager g noop -bind index,pager M noop -bind index,pager C noop -unset hostname -unmy_hdr Organization -unmailboxes * -unalternates * -unset signature - -bind index gg first-entry -- cgit v1.2.3 From b149d1c9ce80f489006c470636ead617b3082e42 Mon Sep 17 00:00:00 2001 From: Cameron Murtagh <43051455+CMurtagh-LGTM@users.noreply.github.com> Date: Tue, 4 Jan 2022 02:23:11 +0000 Subject: Add option to use user mailcap Added the option to have a `mailcap` file in `.config/mutt/`. This enables ease of changing what programs are used for viewing. --- share/mutt-wizard.muttrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index a12a77e..f99d74d 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -3,7 +3,7 @@ # mutt-wizard will have this file sourced from your muttrc. # 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:$mailcap_path +set mailcap_path = $HOME/.config/mutt/mailcap:/usr/local/share/mutt-wizard/mailcap:$mailcap_path 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)" -- cgit v1.2.3 From 67b704808d64850461ecb11d9f6086086dbc1db6 Mon Sep 17 00:00:00 2001 From: Slin Lee Date: Wed, 9 Mar 2022 22:33:24 -0800 Subject: Wrap text when reading emails at 80 chars For increased legibility. --- share/mutt-wizard.muttrc | 1 + 1 file changed, 1 insertion(+) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index f99d74d..3537aa8 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -27,6 +27,7 @@ auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted #set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html +set width = 80 # wordwrap when reading emails bind index,pager i noop bind index,pager g noop -- cgit v1.2.3 From e0f34910f34c2464d2fd57125d2a0542b4b75e63 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 29 Mar 2022 09:24:28 -0400 Subject: Revert "Wrap text when reading emails at 80 chars" This reverts commit 67b704808d64850461ecb11d9f6086086dbc1db6. --- share/mutt-wizard.muttrc | 1 - 1 file changed, 1 deletion(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 3537aa8..f99d74d 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -27,7 +27,6 @@ auto_view text/html # automatically show html (mailcap uses lynx) auto_view application/pgp-encrypted #set display_filter = "tac | sed '/\\\[-- Autoview/,+1d' | tac" # Suppress autoview messages. alternative_order text/plain text/enriched text/html -set width = 80 # wordwrap when reading emails bind index,pager i noop bind index,pager g noop -- cgit v1.2.3 From e9f58514536a042df853df9b5359dfd0ecf02aa0 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Sat, 9 Apr 2022 07:10:14 -0400 Subject: for color update --- share/mutt-wizard.muttrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index f99d74d..3cefeeb 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -161,10 +161,10 @@ color underline black default color normal default default # Regex highlighting: -color header blue default ".*" -color header brightmagenta default "^(From)" -color header brightcyan default "^(Subject)" +color header brightmagenta default "^From" +color header brightcyan default "^Subject" color header brightwhite default "^(CC|BCC)" +color header blue default ".*" color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL color body green default "\`[^\`]*\`" # Green text between ` and ` -- cgit v1.2.3 From ef8cda91cf58be7eec314b4752a4085f4afbec3a Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Tue, 21 Jun 2022 12:59:23 -0400 Subject: fix #792, fix #820 --- share/mutt-wizard.muttrc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'share/mutt-wizard.muttrc') diff --git a/share/mutt-wizard.muttrc b/share/mutt-wizard.muttrc index 3cefeeb..4df16a4 100644 --- a/share/mutt-wizard.muttrc +++ b/share/mutt-wizard.muttrc @@ -57,8 +57,10 @@ bind index,query tag-entry macro browser h '..' "Go to parent folder" bind index,pager H view-raw-message bind browser l select-entry -bind pager,browser gg top-page -bind pager,browser G bottom-page +bind browser gg top-page +bind browser G bottom-page +bind pager gg top +bind pager G bottom bind index,pager,browser d half-down bind index,pager,browser u half-up bind index,pager S sync-mailbox -- cgit v1.2.3