]> git.phdru.name Git - dotfiles.git/blobdiff - .muttrc
Feat(recode-filenames-recursive): Allow to omit parameters
[dotfiles.git] / .muttrc
diff --git a/.muttrc b/.muttrc
index 100f8800c4c981701824b0962108fb0231abe19e..b347d4f6d72bf02c8c243f65171eaecbded05a5a 100644 (file)
--- a/.muttrc
+++ b/.muttrc
@@ -7,6 +7,14 @@
 #
 #set folder=~/Mail                # Where I keep my mailboxes; I am happy with this default
 
+# Character set for my terminal and config files (including aliases)
+set charset=`case "$LC_CTYPE" in *UTF-8) echo utf-8 ;; *) echo koi8-r ;; esac`
+set assumed_charset="us-ascii:utf-8:windows-1251:koi8-r" # Character sets for mail without a charset
+set config_charset=koi8-r # Character set for this config file and alias files
+set send_charset="us-ascii:iso-8859-1:koi8-r:windows-1251:utf-8" # Character sets for outgoing mail
+charset-hook x-unknown koi8-r    # Show unknow encoding as koi8-r
+charset-hook windows-1251 cp1251 # Autoconvert windoze encoding
+
 # source aliases
 source =mutt/aliases
 
@@ -33,14 +41,6 @@ mailboxes ! =admin =block =bulk =spam `echo $HOME/mail/lists/* | sed s#$HOME/mai
 set ascii_chars=`[ -n "$SLOWTERM" ] && echo yes || echo no` # Use ASCII instead of ACS chars for threads
 set arrow_cursor=`[ -n "$SLOWTERM" ] && echo yes || echo no` # Draw a simple cursor on slow terminals
 
-# Character set for my terminal
-set charset=`case "$LC_CTYPE" in *UTF-8) echo utf-8 ;; *) echo koi8-r ;; esac`
-set assumed_charset="us-ascii:utf-8:windows-1251:koi8-r" # Character sets for mail without a charset
-set config_charset=koi8-r # Character set for this config file and alias files
-set send_charset="us-ascii:iso-8859-1:koi8-r:windows-1251:utf-8" # Character sets for outgoing mail
-charset-hook x-unknown koi8-r    # Show unknow encoding as koi8-r
-charset-hook windows-1251 cp1251 # Autoconvert windoze encoding
-
 set index_format="%4C %Z %{%b %d} %-15.15F (%4c) %s" # Somewhat different index format, which works nicely with mail lists.
 set pager_format="%4C %Z %[%b %d] %-15.15F (%4l) %s %* ---(%P)---" # Mostly match index_format
 
@@ -52,7 +52,7 @@ set sort_alias=unsorted
 set sort_browser=alpha
 
 set history=1000                 # Number of lines of history in memory
-set history_file==tmp/.mutt-history
+set history_file==tmp/.mutt_history
 set save_history=1000            # Number of lines of history in file
 
 set read_inc=10                  # Progress indicator when reading folders.
@@ -60,7 +60,9 @@ set write_inc=10                 # Progress indicator when writing folders.
 
 set allow_8bit                   # Never do Q-P encoding on legal 8-bit chars
 set abort_unmodified=no          # Let me send empty messages
-set alias_file==mutt/aliases # Where to store aliases
+set alias_file==tmp/aliases      # Where to store aliases
+set attribution="`case "$LC_TIME" in ru_RU*) echo 'В %{%a, %d %b %Y в %I:%M:%S%p %Z} %f написал(а):' ;; *) echo 'On %d, %f wrote:' ;; esac`" # `
+set attribution_locale=`echo $LC_TIME` # Locale to format dates
 set beep=no                      # Never beep on errors
 set collapse_unread=no           # Do not collapse thread with unread messages
 set confirmappend=no             # Don't ask me if i want to append to mailboxes
@@ -69,7 +71,6 @@ set forward_format="[Fwd: %s]"   # Subject to use when forwarding messages
 set help                         # Show the help lines
 set ignore_list_reply_to         # Ignore Reply-To headers pointing to mailing lists.
 set include=yes                  # Always include a copy when replying.
-set locale=`echo $LC_TIME`       # Locale to format dates
 set mail_check=30                # How often (in seconds) to poll for new mail
 set mark_old=no                  # Distinguish between seen (but unread) and new messages
 set mask=""                      # Show dot-files in the file browser
@@ -78,7 +79,7 @@ set move=no                      # Do not move read messages to ~/mbox
 set pager_context=1              # No. of lines of context to give when scrolling
 set pager_index_lines=6          # How many index lines to show in the pager
 set pager_stop                   # Don't move to the next message on next-page
-set postponed==tmp/.mutt-postponed
+set postponed==tmp/.mutt_postponed
 set print=ask-no                 # Don't waste paper
 set recall=no                    # When I say "compose", ask me whether I want to continue composing a postponed message.
 set reply_regexp="^((re([\\[0-9\\]+])*|aw|на):[ \t]*)+[ \t]*" # A regular expression to detect replies
@@ -90,6 +91,7 @@ set suspend=no                   # Do not suspend on Ctrl+Z
 set tilde                        # Indicate empty lines in the pager.
 set tmpdir=~/tmp                 # Temporary files aren't stored in public places.
 set use_domain=no                # Don't qualify local addresses with $domain
+set use_envelope_from=yes
 set use_ipv6=no                  # Speed up DNS
 set wait_key=no                  # Do not wait for a key after running external programs, pipes
 
@@ -110,6 +112,14 @@ alternative_order text/enriched text/plain text
 #auto_view application/rtf
 #set implicit_autoview # Use copiousoutput filters from mailcap for all types of attachments
 
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+#
+# Encryption: GnuPG
+#
+source /usr/share/doc/mutt/examples/gpg.rc
+set crypt_use_gpgme=no
+set pgp_use_gpg_agent
+
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 #
 # Header fields I don't normally want to see
@@ -117,7 +127,7 @@ alternative_order text/enriched text/plain text
 ignore *                         # Ignore all lines by default
 
 # I do want to see these fields, though!
-unignore date from to x-original-to reply-to mail-followup-to cc \
+unignore date from reply-to mail-followup-to followup-to to x-original-to cc \
    newsgroups subject user-agent x-mailer x-url x-face
 
 # Default list of header fields to weed when displaying
@@ -132,7 +142,7 @@ unignore date from to x-original-to reply-to mail-followup-to cc \
 #       hdr_order <hdr1> [ <hdr2> ... ]
 #
 
-hdr_order date from to x-original-to reply-to mail-followup-to cc \
+hdr_order date from reply-to mail-followup-to followup-to to x-original-to cc \
    newsgroups subject user-agent x-mailer x-url x-face
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@@ -144,7 +154,7 @@ my_hdr X-Attribution: phd
 
 my_hdr X-Face: \"4chVP^f8\;3Bi>x\"ic0%DuP(ZLyn:\;kzQ1njs]5,GRZG<{<\\~\`|Shxi7|)d|8uO~HFRfyym\n\
  {[xs@OYG]2Q]0\#}0sjJp\`1^1+B6]A2+{9fW=S<O7^\"hul]^|AGtiI7SkYF-2VD?UH*h_!zuCIf+^F7\n\
- c0x8?W,UfhCAx^YY\#1ALhvG\\2yG}LW:)zw\#1\;Yajq\"hK~S
+ c0x8?W,UfhCAx^YY\#1ALhvG\\2yG}LW:)zw\#1\;Yajq\"hK~S # `
 
 my_hdr X-Operating-System: Debian GNU/Linux
 
@@ -155,8 +165,9 @@ my_hdr X-Operating-System: Debian GNU/Linux
 #       lists <list-name> [ <list-name> ... ]
 
 subscribe (python-(announce|dev|ideas)|.*-(list|sig))@python\.org \
-   .*@moderators\.isc\.org .*@lists\.sourceforge\.net \
+   core-workflow@python\.org .*@moderators\.isc\.org \
    (durus|quixote)-users@mems-exchange\.org pysqlite@lists\.initd\.org \
+   .*@lists\.sourceforge\.net .*@vex\.net egenix-users@egenix\.com \
    .*@googlegroups\.com mlug@unixcenter\.ru
 
 #lists
@@ -171,10 +182,10 @@ subscribe (python-(announce|dev|ideas)|.*-(list|sig))@python\.org \
 
 # Restore defaults
 folder-hook .* "\
+   set envelope_from_address="phd@phdru.name"; \
    my_hdr From: Oleg Broytman <phd@phdru.name>; \
    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
-   my_hdr X-Url: http://phdru.name/; \
-   set attribution='On %d, %f wrote:'; \
+   my_hdr X-Url: https://phdru.name/; \
    set record==sent-mail; \
    set signature==signatures/phd@phdru.name"
 
@@ -229,36 +240,47 @@ fcc-hook .* =sent-mail
 
 # Restore defaults
 send-hook .* "\
+   set envelope_from_address="phd@phdru.name"; \
+   set followup_to=yes; \
    my_hdr From: Oleg Broytman <phd@phdru.name>; \
    my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
-   my_hdr X-Url: http://phdru.name/; \
-   set attribution='On %d, %f wrote:'; \
+   my_hdr X-Url: https://phdru.name/; \
+   unmy_hdr Mail-Followup-To; \
+   unmy_hdr X-Skip-DKIM-Sig; \
    set signature==signatures/phd@phdru.name"
 
 send-hook "~L '@.*\.(r|s)u$'" "\
    my_hdr From: Олег Бройтман <phd@phdru.name>; \
    my_hdr Reply-To: Олег Бройтман <phd@phdru.name>; \
-   set attribution='В %{%a, %d %b %Y в %I:%M:%S%p %Z} %f написал:'; \
-   set signature==signatures/phd@phdru.name-ru"
+   set signature='iconv -f koi8-r ~/mail/signatures/phd@phdru.name-ru|'"
 
-send-hook "~L '@(mail|list|inbox|bk)\.ru'" "\
+send-hook "~L '@(mail|list|inbox|bk|sweb|spaceweb|ulmart)\.ru'" "\
+   set envelope_from_address="phd@mail.ru"; \
    my_hdr From: Олег Бройтман <phd@mail.ru>; \
    my_hdr Reply-To: Олег Бройтман <phd@mail.ru>; \
-   my_hdr X-Url: http://my.mail.ru/mail/phd; \
-   set signature==signatures/phd@mail.ru"
+   my_hdr X-Url: https://my.mail.ru/mail/phd; \
+   set signature='iconv -f koi8-r ~/mail/signatures/phd@mail.ru|'"
 
 send-hook "~L '(@|\.)(((ya|yandex|narod)\.ru)|(yandex\.com)|yandex-team\.ru)$'" "\
+   set envelope_from_address="phd2@yandex.ru"; \
    my_hdr From: Олег Бройтман <phd2@yandex.ru>; \
    my_hdr Reply-To: Олег Бройтман <phd2@yandex.ru>; \
    my_hdr X-Url: http://phd2.ya.ru/; \
-   set signature==signatures/phd2@yandex.ru"
-
-send-hook ~u unmy_hdr Reply-To
+   set signature='iconv -f koi8-r ~/mail/signatures/phd2@yandex.ru|'"
 
 send-hook "~L python-announce-list@python\.org" "\
    set followup_to=no; \
-   my_hdr Reply-To: python-list@python.org; \
-   my_hdr Mail-Followup-To: phd@phdru.name, python-list@python.org"
+   my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
+   my_hdr Mail-Followup-To: Oleg Broytman <phd@phdru.name>, Python Mailing List <python-list@python.org>"
+
+send-hook "~L cheetahtemplate-announce@lists\.sourceforge\.net" "\
+   set followup_to=no; \
+   my_hdr Reply-To: Oleg Broytman <phd@phdru.name>; \
+   my_hdr Mail-Followup-To: Oleg Broytman <phd@phdru.name>, CheetahTemplate discussion <cheetahtemplate-discuss@lists.sourceforge.net>"
+
+send-hook ~u "\
+   unmy_hdr Reply-To; \
+   my_hdr X-Skip-DKIM-Sig: mailing list"
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 #
@@ -277,36 +299,96 @@ bind index,pager <Esc>S decode-save
 # Macros
 #
 
-# Go to the first folder with unread messages
-macro index C  <Home>c\n
-macro pager C q<Home>c\n
-
-# Move current message to inbox
-macro index,pager S s!\n
-
-macro index,pager <Esc>h ":auto_view text/html\n"
-macro index,pager <Esc>H ":unauto_view text/html\n"
-
-# Pipe spam
-#macro index,pager z |"sa-learn --no-sync --ham\n"
-#macro index,pager Z |"sa-learn --no-sync --spam\n"
-macro index,pager <Esc>s "<Enter>q"|"spamassassin -d | ~/mail/bin/spamcop.py\nj"
-macro index,pager <Esc>z "<Enter>q:set editor='vim -s ~/mail/misc/spamcop.vim'\nr:set editor=vim.sh\nqn"
-
-# Go to main mailbox
-macro index H  <Home>c!\n
-macro pager H q<Home>c!\n
+# KP_Enter -> Enter
+#macro generic,pager,editor <F79> <Enter>
+# KP_Home -> Home
+macro generic,pager,editor <F84> <Home>
+# KP_Up -> Up
+macro generic,pager,editor \1074 <Up>
+# KP_Next -> PageUp
+macro generic,pager,editor <F85> <PageUp>
+# KP_Left -> Left
+macro generic,pager,editor \1075 <Left>
+# KP_Right -> Right
+macro generic,pager,editor \1076 <Right>
+# KP_End -> End
+macro generic,pager,editor <F87> <End>
+# KP_Down -> Down
+macro generic,pager,editor \1077 <Down>
+# KP_Prev -> PageDown
+macro generic,pager,editor <F88> <PageDown>
+
+macro index C \
+   <Home><change-folder><Enter> \
+   "Go to the first folder with unread messages"
+macro pager,attach C \
+   <exit><Home><change-folder><Enter> \
+   "Go to the first folder with unread messages"
+
+macro index,pager S \
+   <save-message>!<Enter> \
+   "Move current message to inbox"
+
+macro index,pager,attach <Esc>h \
+   ":auto_view text/html<Enter>" \
+   "View HTML attachments"
+macro index,pager,attach <Esc>H \
+   ":unauto_view text/html<Enter>" \
+   "Don't show HTML attachments"
+
+macro index <Esc>s \
+   "<pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
+   "Send spam to SpamCop"
+macro pager <Esc>s \
+   "<exit><pipe-message>spamassassin -d | ~/mail/bin/spamcop.py<Enter><next-undeleted>" \
+   "Send spam to SpamCop"
+macro index <Esc>z \
+   ":set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
+   "Process message from SpamCop"
+macro pager <Esc>z \
+   "<exit>:set editor='vim -s ~/mail/misc/spamcop.vim'<Enter><reply>:set editor=vim.sh<Enter><exit>n" \
+   "Process message from SpamCop"
+
+macro index H \
+   <Home><change-folder>!<Enter> \
+   "Go to inbox"
+macro pager,attach H \
+   <exit><Home><change-folder>!<Enter> \
+   "Go to inbox"
+macro index M \
+   <Home><change-folder>=sent-mail<Enter> \
+   "Go to sent-mail"
+macro pager,attach M \
+   <exit><Home><change-folder>=sent-mail<Enter> \
+   "Go to sent-mail"
+
+macro index,pager \cV "<show-version>" \
+   "Show version"
+
+macro index,pager V "v/text/html<Enter>V" \
+   "View the 1st html attachment in a web browser"
+macro attach V "<save-entry>~/tmp/_xxx.html<Enter>n<shell-escape>webbrowser -n ~/tmp/_xxx.html; exec rm ~/tmp/_xxx.html<Enter><exit>" \
+   "View html attachment in a web browser"
 
 # Go to python mailbox
-macro index Y  <Home>c=lists/python\n
-macro pager Y q<Home>c=lists/python\n
+macro index Y \
+   <Home><change-folder>=lists/python<Enter> \
+   "Go to python"
+macro pager,attach Y \
+   <exit><Home><change-folder>=lists/python<Enter> \
+   "Go to python"
 
 # Recode base64 to 8bit, html to plain text, mustdie-1251 to koi8-r, etc.
-macro index,pager M "|mimedecode.py | less\n"
-macro index,pager E ":set editor=mimedecode.sh\ne:set editor=vim.sh\n"
+macro index,pager \
+   <Esc>m "<pipe-message>mimedecode | less<Enter>" \
+   "View MIME-decoded message"
+macro index,pager E \
+   ":set editor=mimedecode.sh<Enter><edit>:set editor=vim.sh<Enter>" \
+   "MIME-decode and save"
 
-# Convert X-Face header to an image and display it
-macro index,pager <Esc>f |"~/mail/bin/view-x-face\n"
+macro index,pager <Esc>f \
+   <pipe-message>~/mail/bin/view-x-face<Enter> \
+   "Convert X-Face header to an image and display it"
 
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 #
@@ -351,7 +433,7 @@ color tilde       blue           default
 color tree        blue           default
 
 # email
-color body        brightblue     default [-a-Z_0-9.+]+@[-a-Z_0-9.]+
+color body        brightmagenta  default [-a-Z_0-9.+]+@[-a-Z_0-9.]+
 
 # URLs
 color body        brightblue     default "(((https?|ftp|gopher|telnet)://|(mailto|file|news|about|ed2k|irc|sip|magnet):)[^' \t<>\"]+)[A-Za-z0-9/]"
@@ -362,10 +444,3 @@ color body        brightmagenta  default " [;:]-*[dp(){}<>|\\/]| [(){}<>|\\/]-*[
 # Attributes when using a mono terminal
 mono header underline ^Subject:
 mono quoted bold
-
-# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-#
-# Encryption: GnuPG
-#
-source /usr/share/doc/mutt/examples/gpg.rc
-set pgp_use_gpg_agent