diff --git a/muttrc b/muttrc new file mode 100644 index 0000000..7aadf86 --- /dev/null +++ b/muttrc @@ -0,0 +1,225 @@ +# mutt config commun +# +# from https://github.com/Nelyah/dotfiles/blob/master/.mutt/settings + +set use_envelope_from=yes + +set reverse_name +set reverse_realname + +# +# paths +# +# set folder = ~/.mail # mailbox location -- set in accounts files +set alias_file = ~/.mutt/muttrc-alias # where to store aliases +source ~/.mutt/muttrc-alias +set header_cache = ~/.mutt/cache/headers # where to store headers +set message_cachedir = ~/.mutt/cache/bodies # where to store bodies +set certificate_file = ~/.mutt/certificates # where to store certs +set tmpdir = ~/.mutt/temp # where to keep temp files +set print = ask-yes +set print_command = lp +set ispell = "aspell check" + +# +# general +# +set mail_check=90 # check mail every (s) +set timeout=15 # wait only (s) max +set editor='vim "+set spelllang=fr"' +set wait_key=no +set user_agent=yes +set mime_forward=yes # set forward message as attach and not in text +set pipe_decode=yes +set pipe_decode_weed=yes + +# text/html .... +alternative_order text/plain text/html +auto_view text/html + +# status format +# default is = "-%r-Mutt: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" +set status_format = "-%r-%v@%h: %f [Msgs:%?M?%M/?%m%?n? New:%n?%?o? Old:%o?%?d? Del:%d?%?F? Flag:%F?%?t? Tag:%t?%?p? Post:%p?%?b? Inc:%b?%?l? %l?]---(%s/%S)-%>-(%P)---" +# +# pager format +# default is "-%Z- %C/%m: %-20.20n %s%* -- (%P)" +set pager_format = "-%Z- %C/%m: from <%n> « %s »%* -- (%P)" + +# +# index +# +# index format dynamic change +# from https://muttmua.gitlab.io/mutt/manual-dev.html#index-format-hook +set index_format="%4C %Z %?H?[%H]? %-10@date@ %-30.30L (%?l?%4l&%4c?) %s" +index-format-hook date "~d<1d" "%[%H:%M]" +index-format-hook date "~d<2d" "hier %[%H:%M]" +index-format-hook date "~d<5d" "%[%a %H:%M]" +index-format-hook date "~d<1m" "%[%a %d]" +index-format-hook date "~d<1y" "%[%d %b]" +index-format-hook date "~A" "%[%m/%Y]" + +set sort = threads # default sorting +set sort_aux = last-date-received # second sorting + +# +# keybinding +# +bind generic first-entry +bind generic first-entry +bind generic last-entry +bind generic last-entry +bind generic previous-entry +bind generic next-entry +bind generic '"' what-key # print key code -- ctrl+g to quit + +bind index G imap-fetch-mail # force fetch new email +bind index K previous-unread +bind index J next-unread +bind index \ct tag-thread +# TODO macro index t untag-pattern + + +bind pager half-up +bind pager half-up +bind pager half-down +bind pager half-down + +# +# Macros +# +macro index .r ":source ~/.mutt/muttrc" "Reload muttrc" +macro index T + +# urlscan/urlview +# FIXME BROKEN macro index,pager \cb "urlscan" "open URL in urlscan" +macro index,pager \cb "urlview" "open URL in urlview" + +# save messages +macro index >I =SERVICE.INFO 'save to service info' +macro index >N =netdata 'save to netdata' +macro index >P =2019-2020-PYL 'Le chef' +macro index >S =SPAM 'save to SPAM' + +# filtres to new/old/flag messages +macro index ,a "~A" "Voir: all" +macro index ,n "(~N|~O|~F)" "Voir: new/flag" +macro index ,f "~F" "Voir: flag" +macro index ,m "(~N|~O)(~p|~P|~C info@)|~C printers@|~C proxmox@|~s 'monit alert'|~s SMART|~F" "Voir: new+from/to me" +macro index ,M "(~p|~P|~C info@|~C printers@)|~C proxmox@|~s 'monit alert'|~s SMART|~F" "Voir: from/to me" +macro index ,t "(~N|~O|~F) ~C tout.?ida@" "Voir: new+toutida" +macro index ,T "~C tout.?ida@" "Voir: toutida" +# filtres autres +macro index ,i "Demande.*inscription" "view inscription" +macro index >i =dalembert-inscription 'save to IMPRIMANTES' +macro index,pager .i ":set wait_key=yesmutt_process:set wait_key=no" 'generate responses from ' +# macro index,pager .i ":set wait_key=yesmutt_process:set wait_key=no" 'generate responses from ' +# macro index /c "~C su-adherents|~C diffusion-fercsup|~C bureau-sntrsjussieu|~C communication-syndicale|~C commob_jussieu|~s CGT|~s 'commission sociale'" "view listes CGT" +macro index ,c "~C corresp_ssi@services.cnrs.fr | ~C cssi_dr2@services.cnrs.fr | ~C netadmin@listes.sorbonne-universite.fr | ~c cssi@listes.sorbonne-universite.fr | ~f support@cert-manager.com | ~s genci " "view CSSI" +macro index >C =CSSI 'save to CSSI' +macro index ,l "logwatch|cron" "view logwatch" +macro index >L =logwatchs 'save to logwatchs' +macro index ,v "~f @brahma" "view brahma logs" +macro index >V =VLAN 'save to VLAN' + +# listes +macro index >A =liste-ASR "save to liste-ASR" +macro index >D =liste-DEBIAN "save to liste-DEBIAN" +macro index >H =liste-hackesr "save to liste-hackesr" +macro index /l "(~C @listes.sorbonne-universite.fr|~C @listes.upmc.fr|~C @services.cnrs.fr|~C @groupes.renater.fr|~C @pmichaud.com|~C @lists.debian.org)" "Voir: Listes" +macro index /m "monit" "Voir: monit" + +### automatic actions +# (push are executed AFTER all commands) +# (multiple push/exec will be exec in reverse order) + +# delete duplicate messages +folder-hook . 'set confirmappend=yes' +folder-hook . 'push ~=' + +## FIXME ne marche pas +# folder-hook INBOX 'set confirmappend=no' +# folder-hook INBOX 'push ,m' +#+ get new messages by default +# folder-hook INBOX 'push CERTFR-=CSSI' +#+ save CERTFR- to =CSSI + +folder-hook INBOX 'push ,m' +#+ get new messages by default + +# identities +macro compose \cf "^Umoi\_" "Select from" + +# +# spam detection - champs %H +# +spam "X-j-chkmail-Status: Spam (.*)" "ju/%1" +spam "X-Spam-Status: Yes" "sa" +spam "X-Amavis-Spam-Status: Yes" "am" +spam "X-Renater-SpamScore: ([1-9][0-9]*)" "re/%1" +set spam_separator="|" + +# +# Messages +# +set rfc2047_parameters # decoded some +set send_charset = "us-ascii:utf-8" # UTF stuff +set assumed_charset = "utf-8" +set charset = "utf-8" +set date_format = "%d %b %Y a %H:%M:%S %Z" +set attribution_locale = "fr_FR.UTF-7" +set attribution="Le %d, %n a écrit :" + + +# +# headers +# +ignore * +unignore from date subject to cc reply-to User-Agent Content-Length +unignore organization organisation x-mailer: x-newsreader: x-mailing-list: +unignore posted-to: List-Id: +unignore X-j-chkmail-Status: X-Spam-Status: X-Amavis-Spam-Status: X-Renater-SpamScore: +# reset header order +unhdr_order * +hdr_order Date: Subject: From: From To: Cc: reply-to: User-Agent: x-mailer: posted-to: List-Id: x-mailing-list: Content-Length: X-*: + +# pager +set pager_stop # dont exit at the end of the message with + +# +# Colors +# +source $HOME/.mutt/muttrc-colors + +# +# Accounts +# +# from https://github.com/Nelyah/dotfiles/blob/master/.mutt/settings +macro generic \Cx| "source" +macro generic \Cx& "macro index \\t \"\\Cx" +source $HOME/.mutt/muttrc-accounts + +# +# GPG +# +source $HOME/.mutt/gpg.rc +set crypt_autosign = yes +set crypt_replysign = yes +set crypt_replyencrypt = yes +set crypt_replysignencrypted = yes +set crypt_protected_headers_write = yes # protect subject +set crypt_protected_headers_subject = 'Sujet Sensible (chiffré)' +# OLD set pgp_default_key = D7B87DFB479CA02E48A2383C00054A3358D16D27 +set pgp_default_key = A8F721C80E43073F40DF8F21B57DBE40C72FBCF4 + +# auto attach pub key from https://stackoverflow.com/a/67065558 +# Esc-k pour inclure manuellement +macro compose y "`echo A8F721C80E43073F40DF8F21B57DBE40C72FBCF4`" +macro compose Y "" + + +# +# Query : ldap +# +# Use with Ctrl+t +set query_command = "$HOME/.mutt/mutt_ldap.sh %s" + diff --git a/muttrc-accounts-warhol b/muttrc-accounts-warhol new file mode 100644 index 0000000..5273f76 --- /dev/null +++ b/muttrc-accounts-warhol @@ -0,0 +1,51 @@ +# mutt config - private datas +set realname = 'Patrick Cao Huu Thien' +set from = 'patrick.cao_huu_thien@sorbonne-universite.fr' +alternates '^patrick.cao_huu_thien@' +alternates '^master.h2zu@gmail.com$' +alternates '^pcao@dalembert.upmc.fr$' + +send-hook . 'set realname="Patrick Cao Huu Thien"' +send-hook "~f ^master.h2zu@gmail.com$" 'set realname="Master ZU"' + +# my host +set hostname = 'dalembert.upmc.fr' +set use_domain + +# SMTP +# +# heywood dont handle TLS -- too old version +set smtp_url=smtp://smtp.dalembert.upmc.fr +unset ssl_force_tls +unset ssl_starttls +# vm11 new postfix +# set smtp_url=smtp://vm11 +# unset ssl_force_tls +# unset ssl_starttls + +# +# accounts +# +source $HOME/.mutt/accounts/dalembert + +#macro generic \Cx0 "\Cx| ~/.mutt/accounts/archive\"\n\Cx&1\"!" +macro generic \Cx0 "\Cx| ~/.mutt/accounts/dalembert\"\n\Cx&1\"!" +macro generic \Cx1 "\Cx| ~/.mutt/accounts/gmail\"\n\Cx&0\"!" +# +# switch account with +macro index "\Cx1" +macro index "\Cx0" +macro index "\Cx1" +macro index "\Cx2" + + +# +# Listes +# +subscribe .*@listes.upmc.fr +subscribe .*@listes.sorbonne-universite.fr +subscribe .*@lists.debian.org +subscribe .*@pmichaud.com +subscribe .*@services.cnrs.fr +subscribe .*@listes.fercsup-cgt.org +subscribe .*@groupes.renater.fr