From a514a615c56d94211efe62ea1f3ce31f10d65629 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sun, 1 May 2022 11:21:44 +0200 Subject: mutt: Use XDG compliant config location .config/mutt/*: Use XDG_CONFIG_DIR compliant config location --- .config/mutt/accounts.rc | 7 +++ .config/mutt/attachments.rc | 2 + .config/mutt/color.rc | 84 ++++++++++++++++++++++++++++++++++++ .config/mutt/dave@sleepmap.de.rc | 12 ++++++ .config/mutt/dave@sleepmap.de.sig | 1 + .config/mutt/default.rc | 11 +++++ .config/mutt/dvzrv@archlinux.org.rc | 12 ++++++ .config/mutt/dvzrv@archlinux.org.sig | 1 + .config/mutt/gpg.rc | 17 ++++++++ .config/mutt/khard.rc | 5 +++ .config/mutt/macros.rc | 49 +++++++++++++++++++++ .config/mutt/muttrc | 32 ++++++++++++++ .config/mutt/security.rc | 2 + .config/mutt/sidebar.rc | 14 ++++++ .config/mutt/sorting.rc | 2 + 15 files changed, 251 insertions(+) create mode 100644 .config/mutt/accounts.rc create mode 100644 .config/mutt/attachments.rc create mode 100644 .config/mutt/color.rc create mode 100644 .config/mutt/dave@sleepmap.de.rc create mode 100644 .config/mutt/dave@sleepmap.de.sig create mode 100644 .config/mutt/default.rc create mode 100644 .config/mutt/dvzrv@archlinux.org.rc create mode 100644 .config/mutt/dvzrv@archlinux.org.sig create mode 100644 .config/mutt/gpg.rc create mode 100644 .config/mutt/khard.rc create mode 100644 .config/mutt/macros.rc create mode 100644 .config/mutt/muttrc create mode 100644 .config/mutt/security.rc create mode 100644 .config/mutt/sidebar.rc create mode 100644 .config/mutt/sorting.rc (limited to '.config/mutt') diff --git a/.config/mutt/accounts.rc b/.config/mutt/accounts.rc new file mode 100644 index 0000000..fb8eac2 --- /dev/null +++ b/.config/mutt/accounts.rc @@ -0,0 +1,7 @@ +# dave@sleepmap.de (default) +set spoolfile = "+dave@sleepmap.de/INBOX" +source "~/.mutt/dave@sleepmap.de.rc" +folder-hook dave@sleepmap.de/* source ~/.mutt/dave@sleepmap.de.rc + +# dvzrv@archlinux.org +folder-hook dvzrv@archlinux.org/* source ~/.mutt/dvzrv@archlinux.org.rc diff --git a/.config/mutt/attachments.rc b/.config/mutt/attachments.rc new file mode 100644 index 0000000..693f174 --- /dev/null +++ b/.config/mutt/attachments.rc @@ -0,0 +1,2 @@ +set mime_forward=yes +set mime_forward_rest=yes diff --git a/.config/mutt/color.rc b/.config/mutt/color.rc new file mode 100644 index 0000000..b413dca --- /dev/null +++ b/.config/mutt/color.rc @@ -0,0 +1,84 @@ +# Colors for items in the index +color index brightcyan default ~N +color index brightred default ~O +color index brightyellow default ~F +color index black green ~T +color index brightred default ~D +mono index bold ~N +mono index bold ~F +mono index bold ~T +mono index bold ~D + +# Highlights inside the body of a message. + +# URLs +color body brightgreen default "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*" +color body brightgreen default "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+" +mono body bold "(http|ftp|news|telnet|finger)://[^ \"\t\r\n]*" +mono body bold "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+" + +# Email addresses. +color body brightgreen default "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+" + +# Header +color header green default "^from:" +color header green default "^to:" +color header green default "^cc:" +color header green default "^date:" +color header yellow default "^newsgroups:" +color header yellow default "^reply-to:" +color header brightcyan default "^subject:" +color header red default "^x-spam-rule:" +color header green default "^x-mailer:" +color header yellow default "^message-id:" +color header yellow default "^Organization:" +color header yellow default "^Organisation:" +color header yellow default "^User-Agent:" +color header yellow default "^message-id: .*pine" +color header yellow default "^X-Fnord:" +color header yellow default "^X-WebTV-Stationery:" + +color header red default "^x-spam-rule:" +color header green default "^x-mailer:" +color header yellow default "^message-id:" +color header yellow default "^Organization:" +color header yellow default "^Organisation:" +color header yellow default "^User-Agent:" +color header yellow default "^message-id: .*pine" +color header yellow default "^X-Fnord:" +color header yellow default "^X-WebTV-Stationery:" +color header yellow default "^X-Message-Flag:" +color header yellow default "^X-Spam-Status:" +color header yellow default "^X-SpamProbe:" +color header red default "^X-SpamProbe: SPAM" + +# Coloring quoted text - coloring the first 7 levels: +color quoted cyan default +color quoted1 yellow default +color quoted2 red default +color quoted3 green default +color quoted4 cyan default +color quoted5 yellow default +color quoted6 red default +color quoted7 green default + +# Default color definitions +#color hdrdefault white green +color signature brightmagenta default +color indicator black cyan +color attachment black green +color error red default +color message white default +color search brightwhite magenta +color status brightyellow blue +color tree brightblue default +color normal white default +color tilde green default +color bold brightyellow default +color underline magenta default +color markers brightcyan default + +# Color definitions when on a mono screen +mono bold bold +mono underline underline +mono indicator reverse diff --git a/.config/mutt/dave@sleepmap.de.rc b/.config/mutt/dave@sleepmap.de.rc new file mode 100644 index 0000000..402f92f --- /dev/null +++ b/.config/mutt/dave@sleepmap.de.rc @@ -0,0 +1,12 @@ +set from = "David Runge " +set sendmail = "/usr/bin/msmtp -a sleepmap.de" +set folder = "~/.mail/dave@sleepmap.de" +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set record = "+Sent" +set realname = "David Runge" +set signature = "~/.mutt/dave@sleepmap.de.sig" +set pgp_default_key = '1793DAD5D803A8FFD7451697BB992F9864FAD168' + +color status green default + diff --git a/.config/mutt/dave@sleepmap.de.sig b/.config/mutt/dave@sleepmap.de.sig new file mode 100644 index 0000000..b50b097 --- /dev/null +++ b/.config/mutt/dave@sleepmap.de.sig @@ -0,0 +1 @@ +https://sleepmap.de diff --git a/.config/mutt/default.rc b/.config/mutt/default.rc new file mode 100644 index 0000000..48156bd --- /dev/null +++ b/.config/mutt/default.rc @@ -0,0 +1,11 @@ +set editor=`echo \$EDITOR` +set folder = "~/.mail" +set mbox_type = Maildir + +set date_format = "%F %T (%Z)" +set index_format = "%4C %D %Z %-15.15L (%?l?%4l&%4c?) %s" +set folder_format = "%2C %N %2l %-8.8u %-8.8g %8s %d %f" +set send_charset="utf-8" + +auto_view text/html # view html automatically +alternative_order text/plain text/enriched text/html # save html for last diff --git a/.config/mutt/dvzrv@archlinux.org.rc b/.config/mutt/dvzrv@archlinux.org.rc new file mode 100644 index 0000000..ab6ce25 --- /dev/null +++ b/.config/mutt/dvzrv@archlinux.org.rc @@ -0,0 +1,12 @@ +set from = "David Runge " +set sendmail = "/usr/bin/msmtp -a archlinux.org" +set folder = "~/.mail/dvzrv@archlinux.org" +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set record = "+Sent" +set realname = "David Runge" +set signature = "~/.mutt/dvzrv@archlinux.org.sig" +set pgp_default_key = 'C7E7849466FE2358343588377258734B41C31549' + +color status green default + diff --git a/.config/mutt/dvzrv@archlinux.org.sig b/.config/mutt/dvzrv@archlinux.org.sig new file mode 100644 index 0000000..23af390 --- /dev/null +++ b/.config/mutt/dvzrv@archlinux.org.sig @@ -0,0 +1 @@ +https://archlinux.org diff --git a/.config/mutt/gpg.rc b/.config/mutt/gpg.rc new file mode 100644 index 0000000..502de7b --- /dev/null +++ b/.config/mutt/gpg.rc @@ -0,0 +1,17 @@ +set pgp_good_sign="^gpg: Good signature from " +set pgp_use_gpg_agent = yes +set pgp_self_encrypt = yes +set pgp_default_key = '1793DAD5D803A8FFD7451697BB992F9864FAD168' +set pgp_timeout = 60 +set pgp_verify_command = "gpg --batch --output - --verify %s %f" +set crypt_use_gpgme = yes +set crypt_autosign = yes +set crypt_replyencrypt = yes +set crypt_replysignencrypted = yes +set crypt_protected_headers_write = yes + +# add message-hook for non standard-compliant (old) gnupg style messages +message-hook '!(~g|~G) ~b"^-----BEGIN\ PGP\ (SIGNED\ )?MESSAGE"' "exec check-traditional-pgp" + +send-hook . 'reset crypt_autoencrypt' +source "~/.mutt/gpg-auto.rc" diff --git a/.config/mutt/khard.rc b/.config/mutt/khard.rc new file mode 100644 index 0000000..12c9b39 --- /dev/null +++ b/.config/mutt/khard.rc @@ -0,0 +1,5 @@ +# auto-completing mails when pressing tab in "new mail" dialog using khard address books +set query_command= "khard email -p -s last_name -d first_name %s" +bind editor complete-query +bind editor ^T complete + diff --git a/.config/mutt/macros.rc b/.config/mutt/macros.rc new file mode 100644 index 0000000..83dd9d0 --- /dev/null +++ b/.config/mutt/macros.rc @@ -0,0 +1,49 @@ + +# source folder settings and enter folder +macro index,pager 'source ~/.mutt/dave@sleepmap.de.rc!' +macro index,pager 'source ~/.mutt/dvzrv@archlinux.org.rc!' + +macro attach W \ + "~/Downloads/" \ + "Save attachment to ~/Downloads." + +macro index D \ + "+Trash" \ + "Move message to Trash" + +macro index S \ + "+Spam" \ + "Move message to Spam." + +macro index I \ + "=Archives/INBOX/2020" \ + "Archive tagged INBOX message(s) in Archives.INBOX.2020" + +macro index G \ + "=Archives/Sent/2020" \ + "Archive tagged Sent message(s) in Archives.Sent.2020" + +macro index,pager A \ + "khard add-email" \ + "Add the sender email address to khard" + +macro index \ + "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ + notmuch-mutt -r --prompt search\ + `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ + set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: search mail" + +macro index \ + "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ + notmuch-mutt -r thread\ + `echo ${XDG_CACHE_HOME:-$HOME/.cache}/notmuch/mutt/results`\ + set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: reconstruct thread" + +macro index \ + "set my_old_pipe_decode=\$pipe_decode my_old_wait_key=\$wait_key nopipe_decode nowait_key\ + notmuch-mutt tag -- -inbox\ + set pipe_decode=\$my_old_pipe_decode wait_key=\$my_old_wait_key" \ + "notmuch: remove message from inbox" + diff --git a/.config/mutt/muttrc b/.config/mutt/muttrc new file mode 100644 index 0000000..f990e46 --- /dev/null +++ b/.config/mutt/muttrc @@ -0,0 +1,32 @@ +# defaults +source "~/.mutt/default.rc" + +# color +source "~/.mutt/color.rc" + +# gnupg +source "~/.mutt/gpg.rc" + +# mailboxes (set by offlineimap) +source "~/.mutt/mailboxes.rc" + +# sorting +source "~/.mutt/sorting.rc" + +# attachments +source "~/.mutt/attachments.rc" + +# khard (contacts) +source "~/.mutt/khard.rc" + +# accounts +source "~/.mutt/accounts.rc" + +# macros +source "~/.mutt/macros.rc" + +# security +source "~/.mutt/security.rc" + +# sidebar +source "~/.mutt/sidebar.rc" diff --git a/.config/mutt/security.rc b/.config/mutt/security.rc new file mode 100644 index 0000000..af00478 --- /dev/null +++ b/.config/mutt/security.rc @@ -0,0 +1,2 @@ +# disable enter-command (so password commands won't show up in command history) +bind generic,alias,attach,browser,editor,index,compose,pager,pgp,postpone ':' noop diff --git a/.config/mutt/sidebar.rc b/.config/mutt/sidebar.rc new file mode 100644 index 0000000..c3c130c --- /dev/null +++ b/.config/mutt/sidebar.rc @@ -0,0 +1,14 @@ +set browser_abbreviate_mailboxes = no +set sidebar_visible = yes +set sidebar_folder_indent = yes +set sidebar_short_path = yes +set sidebar_width = 30 + +macro index b 'toggle sidebar_visible' +macro pager b 'toggle sidebar_visible' + +# Ctrl-n, Ctrl-p to select next, previous folder. +# Ctrl-o to open selected folder. +bind index,pager \CP sidebar-prev +bind index,pager \CN sidebar-next +bind index,pager \CO sidebar-open diff --git a/.config/mutt/sorting.rc b/.config/mutt/sorting.rc new file mode 100644 index 0000000..48827f7 --- /dev/null +++ b/.config/mutt/sorting.rc @@ -0,0 +1,2 @@ +set sort = "threads" +set sort_aux = "last-date-received" -- cgit v1.2.3-70-g09d2