commit 7ec53f32c337f245767f402e0a69a8bb2dc1ee0d parent 25a61d07d1d754a1febc1c294d6dddbe7703cf7b Author: Sven Möller <sven@svenmoeller.xyz> Date: Thu, 2 Jun 2022 18:05:00 +0200 Add neomutt config Diffstat:
A | neomutt/.config/neomutt/colors | | | 67 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | neomutt/.config/neomutt/gpg.rc | | | 131 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
A | neomutt/.config/neomutt/mailcap | | | 9 | +++++++++ |
A | neomutt/.config/neomutt/neomuttrc | | | 101 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
4 files changed, 308 insertions(+), 0 deletions(-)
diff --git a/neomutt/.config/neomutt/colors b/neomutt/.config/neomutt/colors @@ -0,0 +1,67 @@ +# vim: filetype=neomuttrc +# Default index colors: +color index yellow default '.*' +color index_author red default '.*' +color index_number blue default +color index_subject cyan default '.*' + +# For new mail: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Header colors: +color header blue default ".*" +color header brightmagenta default "^(From)" +color header brightcyan default "^(Subject)" +color header brightwhite default "^(CC|BCC)" + +mono bold bold +mono underline underline +mono indicator reverse +mono error bold +color normal default default +color indicator brightblack white +color sidebar_highlight red default +color sidebar_divider brightblack black +color sidebar_flagged red black +color sidebar_new green black +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default +color normal default 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 ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" diff --git a/neomutt/.config/neomutt/gpg.rc b/neomutt/.config/neomutt/gpg.rc @@ -0,0 +1,131 @@ +# -*-muttrc-*- +# +# Command formats for gpg. +# +# Version notes: +# +# GPG 2.1 introduces the option "--pinentry-mode", which requires +# the "loopback" argument in instances where "--passphrase-fd" is +# used. +# +# Some of the older commented-out versions of the commands use gpg-2comp from: +# http://70t.de/download/gpg-2comp.tar.gz +# +# %p The empty string when no passphrase is needed, +# the string "PGPPASSFD=0" if one is needed. +# +# This is mostly used in conditional % sequences. +# +# %f Most PGP commands operate on a single file or a file +# containing a message. %f expands to this file's name. +# +# %s When verifying signatures, there is another temporary file +# containing the detached signature. %s expands to this +# file's name. +# +# %a In "signing" contexts, this expands to the value of the +# configuration variable $pgp_sign_as, if set, otherwise +# $pgp_default_key. You probably need to +# use this within a conditional % sequence. +# +# %r In many contexts, neomutt passes key IDs to pgp. %r expands to +# a list of key IDs. + +# Section A: Key Management + +# The default key for encryption (used by $pgp_self_encrypt and +# $postpone_encrypt). +# +# It will also be used for signing unless $pgp_sign_as is set to a +# key. +# +# Unless your key does not have encryption capability, uncomment this +# line and replace the keyid with your own. +# +# set pgp_default_key="0x12345678" + +# If you have a separate signing key, or your key _only_ has signing +# capability, uncomment this line and replace the keyid with your +# signing keyid. +# +# set pgp_sign_as="0x87654321" + + +# Section B: Commands + +# Note that we explicitly set the comment armor header since GnuPG, when used +# in some localiaztion environments, generates 8bit data in that header, thereby +# breaking PGP/MIME. + +# decode application/pgp +# +set pgp_decode_command="gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - %f" + +# Verify a signature +# +set pgp_verify_command="gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" + +# Decrypt an attachment +# +set pgp_decrypt_command="gpg --status-fd=2 %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --quiet --batch --output - --decrypt %f" + +# Create a PGP/MIME signed attachment +# +# set pgp_sign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --detach-sign --textmode %?a?-u %a? %f" +# +set pgp_sign_command="gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --detach-sign %f" + +# Create a application/pgp inline signed message. This style is obsolete but still needed for Hushmail recipients and some MUAs. +# +# set pgp_clearsign_command="gpg-2comp --comment '' --no-verbose --batch --output - %?p?--passphrase-fd 0? --armor --textmode --clearsign %?a?-u %a? %f" +# +set pgp_clearsign_command="gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --no-verbose --batch --quiet --output - --armor --textmode %?a?--local-user %a? --clearsign %f" + +# Create an encrypted attachment (note that some users include the --always-trust option here) +# +# set pgp_encrypt_only_command="/usr/lib/neomutt/pgpewrap gpg-2comp -v --batch --output - --encrypt --textmode --armor --always-trust -- -r %r -- %f" +# +set pgp_encrypt_only_command="/usr/lib/neomutt/pgpewrap gpg --batch --quiet --no-verbose --output - --textmode --armor --encrypt -- --recipient %r -- %f" + +# Create an encrypted and signed attachment (note that some users include the --always-trust option here) +# +# set pgp_encrypt_sign_command="/usr/lib/neomutt/pgpewrap gpg-2comp %?p?--passphrase-fd 0? -v --batch --output - --encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f" +# +set pgp_encrypt_sign_command="/usr/lib/neomutt/pgpewrap gpg %?p?--pinentry-mode loopback --passphrase-fd 0? --batch --quiet --no-verbose --textmode --output - %?a?--local-user %a? --armor --sign --encrypt -- --recipient %r -- %f" + +# Import a key into the public key ring +# +set pgp_import_command="gpg --no-verbose --import %f" + +# Export a key from the public key ring +# +set pgp_export_command="gpg --no-verbose --armor --export %r" + +# Verify a key +# +set pgp_verify_key_command="gpg --verbose --batch --fingerprint --check-sigs %r" + +# Read in the public key ring +# +set pgp_list_pubring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-keys %r" + +# Read in the secret key ring +# +set pgp_list_secring_command="gpg --no-verbose --batch --quiet --with-colons --with-fingerprint --with-fingerprint --list-secret-keys %r" + +# Fetch keys +# set pgp_getkeys_command="pkspxycwrap %r" + +# pattern for good signature - may need to be adapted to locale! +# OK, here's a version which uses gnupg's message catalog: +# set pgp_good_sign="^gpgv?: Good signature from" +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" +# +# Output pattern to indicate a valid signature using --status-fd messages +set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" + +# Output pattern to verify a decryption occurred +# This is now deprecated by pgp_check_gpg_decrypt_status_fd: +# set pgp_decryption_okay="^\\[GNUPG:\\] DECRYPTION_OKAY" +set pgp_check_gpg_decrypt_status_fd + diff --git a/neomutt/.config/neomutt/mailcap b/neomutt/.config/neomutt/mailcap @@ -0,0 +1,9 @@ +image/*; lh %s +application/pdf; lh %s +text/html;lh %s; nametemplate=%s.html +text/html; w3m -I %{charset} -T text/html; copiousoutput; +application/oleobject; libreoffice %s +application/vnd.oasis.opendocument.text; libreoffice %s +application/vnd.oasis.opendocument.spreadsheet; libreoffice %s +application/vnd.oasis.opendocument.presentation; libreoffice %s +application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; libreoffice %s diff --git a/neomutt/.config/neomutt/neomuttrc b/neomutt/.config/neomutt/neomuttrc @@ -0,0 +1,101 @@ +set sort = 'threads' +set sort_aux = reverse-last-date-received +set sleep_time = 0 +set wait_key = no +set markers = no +set nm_exclude_tags = deleted + +set mailcap_path = ~/.config/neomutt/mailcap +auto_view text/html +alternative_order text/plain text/html + +# Sidebar +set sidebar_visible +set sidebar_format = "%D%?F? [%F]?%* %?N?%N/?%?S?%S?" +set mail_check_stats +bind index,pager \Ck sidebar-prev # Ctrl-Shift-P - Previous Mailbox +bind index,pager \Cj sidebar-next # Ctrl-Shift-N - Next Mailbox +bind index,pager \Co sidebar-open # Ctrl-Shift-O - Open Highlighted Mailbox +bind index,pager b sidebar-toggle-visible # Use 'B' to switch the Sidebar on and off + +#macro index,pager A "<modify-labels>+archive -unread -inbox\n<change-vfolder>inbox\n" "Archive message" +macro index,pager c "<change-vfolder>?" "Change to vfolder overview" +bind index,pager \Cf vfolder-from-query +#bind index,pager T sidebar-toggle-virtual +#macro index,pager t "<modify-labels>" "Modify notmuch tag" + +macro compose a "<attach-file>?" + +set folder = "~/.mail/mailbox" +set sendmail="/usr/bin/msmtp" +set edit_headers=no + +#Mailbox.org +mailboxes +Inbox +Drafts +Sent +Junk +Trash +Archive +set from="Sven Möller <sven.moeller@mailbox.org>" +set spoolfile="+Inbox" +set record="+Sent" +set postponed="+Drafts" +set trash="+Trash" + +set query_command= "khard email --parsable %s" +bind editor <Tab> complete-query +bind editor ^T complete +macro index,pager a \ + "<pipe-message>khard add-email<return>" \ + "add the sender email address to khard" + +source colors +source gpg.rc + +#set pgp_autosign=yes +set pgp_use_gpg_agent=yes + +bind index,pager g noop +bind index gg first-entry +bind pager gg top +bind index G last-entry +bind pager G bottom +bind index N search-opposite +bind index R group-reply +bind index l display-message +bind index Q exit +bind index h noop +bind index \Cy previous-undeleted +bind index \Ce next-undeleted +bind pager N search-opposite +bind pager k previous-line +bind pager \Cy previous-line +bind pager <Up> previous-line +bind pager j next-line +bind pager \Ce next-line +bind pager <Down> next-line +bind pager R group-reply +bind pager l view-attachments +bind pager Q quit +bind pager,attach h exit +bind attach l view-attach +bind index,pager S sync-mailbox +bind index p recall-message +bind index , tag-prefix +bind index <insert> toggle-new +bind index O sort-reverse +macro compose p "<postpone-message><shell-escape>notmuch-hook.sh<enter>" +macro index gi "<change-folder>+outlook/Inbox<enter>" "Go to inbox" +macro index ga "<change-folder>+mailbox/Archive<enter>" "Go to archiv" +macro index gs "<change-folder>+outlook/Sent<enter>" "Go to sent" +macro index,pager S "<sync-mailbox><shell-escape>mbsync -a && notmuch new<enter>" "Run isync" +macro index,pager A "<save-message>+mailbox/Archive<enter><enter>" "Archive" +macro index,pager M "<save-message>+archiv/" "Move" +macro index,pager T "<tag-pattern>" "Tag" +macro index,pager \ca "<tag-pattern>.*<enter>" "Select all" + +macro pager \cb <pipe-entry>'urlscan'<enter> 'Follow links with urlscan' + +# Saner copy/move dialogs +#macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox" +#macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox" + +## Make quick html view macro +bind index,pager V noop ## Unbinds V from version +macro index,pager V "<view-attachments><search>html<enter><view-mailcap><exit>"