prepare for new laptop
[dotfiles.git] / email / .config / mutt / muttrc
index 98f54ca..b4c3d0c 100644 (file)
@@ -1,34 +1,45 @@
+# source net on first open
+source ~/.config/mutt/net.muttrc
+
 # Basic information
-set from="mart@martlubbers.net"
-alternates "mart@(cs\.ru\.nl|mart@martlubbers\.net)"
+alternates "(mart@cs\.ru\.nl|m\.lubbers@cs\.ru\.nl|mart@martlubbers\.net|Mart\.Lubbers@ru\.nl)"
 set use_from=yes
 set reverse_name=yes
 set envelope_from=yes
 set mbox_type=Maildir
-set folder=~/.local/share/offlineimap/mail
-set spoolfile=+/INBOX/
-set record=+/Sent/
-set postponed=+/Drafts/
 set mask="!^\\.[^.]"
 source ~/.local/share/offlineimap/mailboxes
 
 # Receiving, sending and searching
-set sendmail="/home/mrl/.config/mutt/checkattach.sh msmtp -a net"
+set sendmail="checkattach.sh msmtp -a net"
 set send_charset="us-ascii:utf-8"
-macro index,pager $ "<shell-escape>/home/mrl/.config/mutt/force_sync.sh<enter><sync-mailbox>" "Force refresh"
+macro index,pager $ "<shell-escape>sync_mail.sh<enter><sync-mailbox>" "Force refresh"
+
+# viewing and printing
 macro attach B "<pipe-entry>firefox \"data:text/html;base64,$(base64 -w 0 <&0)\"<enter>"
+set print_command='set -e; f=`mktemp -p "$HOME"/.cache/mutt`; \
+        muttprint -P A4 -p TO_FILE:"$f"; evince "$f"; rm "$f"'
 
 # Set the correct msmtp account for the different addresses
 send2-hook '~f mart@martlubbers.net'\
-       'set sendmail="/home/mrl/.config/mutt/checkattach.sh msmtp -a net"'
+       'set sendmail="checkattach.sh msmtp -a net"'
 send2-hook '((~f m.lubbers@cs.ru.nl)|(~f m.lubbers@science.ru.nl)|(~f mart@cs.ru.nl))'\
-       'set sendmail="/home/mrl/.config/mutt/checkattach.sh msmtp -a ru"'
+       'set sendmail="checkattach.sh msmtp -a ru"'
+send2-hook '((~f mart.lubbers@ru.nl))'\
+       'set sendmail="checkattach.sh msmtp -a ru"'
 
 # Macro for switching to the ru address
-macro compose <esc>2 "<esc>f^UMart Lubbers <mart@cs.ru.nl><enter>"
-# Disable pgp when sending from a ru address
-send2-hook '((~f m.lubbers@cs.ru.nl)|(~f m.lubbers@science.ru.nl)|(~f mart@cs.ru.nl)) (~g|~G)'\
-       'push <pgp-menu>c'
+alias identity_1         Mart Lubbers <mart@martlubbers.net>
+alias identity_2         Mart Lubbers <mart@cs.ru.nl>
+macro compose v "<edit-from>^Uidentity\_<tab>" "Select from"
+macro compose <esc>1 "<esc>f^UMart Lubbers <mart@martlubbers.net><enter>ps"
+macro compose <esc>2 "<esc>f^UMart Lubbers <mart@cs.ru.nl><enter>ps"
+macro compose <esc>3 "<esc>f^UMart Lubbers <mart.lubbers@ru.nl><enter>pc"
+
+macro index,compose <esc>1 "<enter-command>source ~/.config/mutt/net.muttrc<enter><change-folder>=INBOX<enter>"
+macro index,compose <esc>2 "<enter-command>source ~/.config/mutt/ru.muttrc<enter><change-folder>=INBOX<enter>"
+folder-hook ~/.local/share/offlineimap/mail/net/* 'source ~/.config/mutt/net.muttrc'
+folder-hook ~/.local/share/offlineimap/mail/ru/* 'source ~/.config/mutt/ru.muttrc'
 
 # Key bindings
 bind index gg first-entry
@@ -42,11 +53,13 @@ bind index,pager F flag-message
 
 # Misc options
 set timeout=2
+set sleep_time=0
 set mail_check=0
 set include=yes
 set delete=yes
 set confirmappend=no
 set fast_reply=yes
+set mark_old=no
 
 # Display options
 unset wait_key
@@ -54,7 +67,7 @@ unset markers
 set sort_browser=alpha
 set sort=threads
 set sort_aux=date
-set editor=vim
+set editor="vim"
 set duplicate_threads=yes
 ignore headers *
 unignore headers from to subject date cc
@@ -67,14 +80,17 @@ auto_view text/html
 auto_view application/pdf
 # khal
 auto_view application/ics
+auto_view text/calendar
 # libreoffice --cat
 auto_view application/vnd.openxmlformats-officedocument.wordprocessingml.document
-auto_view application/msword
-auto_view application/vnd.openxmlformats-officedocument.wordprocessingml.document
 auto_view application/vnd.oasis.opendocument.text
+auto_view application/msword
+# vcards
+auto_view text/x-vcard
 
 # Pager options
-set pager_index_lines=20
+#set pager=/usr/share/vim/vim82/macros/less.sh
+set pager_index_lines=5
 set pager_context=3
 set pager_stop
 set menu_scroll
@@ -90,7 +106,7 @@ macro index,pager A \
     "add the sender email address to khard"
 
 # sidebar
-source ~/.config/mutt/sidebar.muttrc
+#source ~/.config/mutt/sidebar.muttrc
 
 # notmuch
 source ~/.config/mutt/notmuch.muttrc