From de2043de66c9e26bc0e8e5e7a6d63aa05d0583c3 Mon Sep 17 00:00:00 2001 From: Patrick Cao Huu Thien Date: Wed, 19 Jun 2024 13:29:54 +0200 Subject: [PATCH] muttrc error config --- muttrc-accounts-lhote | 18 +++++----- muttrc-lhote | 78 +++++++++++++++++++++++++++++++------------ 2 files changed, 66 insertions(+), 30 deletions(-) diff --git a/muttrc-accounts-lhote b/muttrc-accounts-lhote index e4a1444..3484b4d 100644 --- a/muttrc-accounts-lhote +++ b/muttrc-accounts-lhote @@ -1,4 +1,4 @@ - +# mutt config - private datas set realname = 'Patrick Cao Huu Thien' set from = 'patrick.cao_huu_thien@sorbonne-universite.fr' alternates '^patrick.cao_huu_thien@' @@ -15,23 +15,23 @@ set use_domain # SMTP # # heywood dont handle TLS -- too old version -set smtp_url=smtp://heywood.dalembert.upmc.fr -unset ssl_force_tls -unset ssl_starttls +set smtp_url=smtps://imap.dalembert.upmc.fr +# unset ssl_force_tls +# unset ssl_starttls # set smtp_url=smtp://mail.lam.jussieu.fr # # accounts # -source /home/patrick/.mutt/accounts/upmc-offline +source /home/patrick/.mutt/accounts/default -macro generic \Cx0 "\Cx| ~/.mutt/accounts/upmc-offline\"\n\Cx&1\"!" -macro generic \Cx1 "\Cx| ~/.mutt/accounts/gmail-offline\"\n\Cx&0\"!" +macro generic \Cx0 "\Cx| ~/.mutt/accounts/default\"\n\Cx&1\"!" +macro generic \Cx1 "\Cx| ~/.mutt/accounts/gmail\"\n\Cx&0\"!" # switch account with macro index "\Cx1" -macro index 'source ~/.mutt/accounts/upmc-offline!' -macro index 'source ~/.mutt/accounts/gmail-offline!' +macro index 'source ~/.mutt/accounts/default!' +macro index 'source ~/.mutt/accounts/gmail!' diff --git a/muttrc-lhote b/muttrc-lhote index 405c64d..a661351 100644 --- a/muttrc-lhote +++ b/muttrc-lhote @@ -1,3 +1,6 @@ +# mutt config commun +# +# from https://github.com/Nelyah/dotfiles/blob/master/.mutt/settings set use_envelope_from=yes @@ -14,9 +17,9 @@ 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" -set mbox_type = "MailDir" # # general @@ -24,8 +27,11 @@ set mbox_type = "MailDir" set mail_check=90 # check mail every (s) set timeout=15 # wait only (s) max set editor='vim "+set spelllang=fr"' -set nowait_key +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 @@ -69,6 +75,10 @@ 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 @@ -77,39 +87,43 @@ bind pager half-down # # Macros # +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 >C =CSSI 'save to CSSI' -macro index >i =dalembert-inscription 'save to IMPRIMANTES' -macro index ,i "Demande.*inscription" "view logwatch" macro index >I =SERVICE.INFO 'save to service info' -macro index >L =logwatchs 'save to logwatchs' -macro index ,l "logwatch" "view logwatch" macro index >N =netdata 'save to netdata' macro index >P =2019-2020-PYL 'Le chef' macro index >S =SPAM 'save to SPAM' -macro index >V =VLAN 'save to VLAN' -macro index ,v "vlan" "view vlan" - -# urlscan -macro index,pager \cb "urlscan" "open URL in urlscan" - -# limit to new/old/flag messages +# filtres to new/old/flag messages macro index ,a "~A" "Voir: all" macro index ,n "(~N|~O|~F)" "Voir: new/flag" -macro index ,m "(~N|~O)(~p|~P|~C info@|~C printers@|~C proxmox@|~s monit)|~F" "Voir: new+from/to me" -macro index ,M "(~p|~P|~C info@|~C printers@|~C proxmox@|~s monit)|~F" "Voir: from/to me" +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 logwatch" +macro index >i =dalembert-inscription 'save to IMPRIMANTES' +macro index,pager .i "mutt_process | LESS=-RC less" +# macro index,pager .i ":set wait_key=yesmutt_inscription:set wait_key=no" +# 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' -macro index /a "~C asr@services.cnrs.fr" "Voir: liste-ASR" +# listes macro index >A =liste-ASR "save to liste-ASR" -macro index /h "~C hackesr@groupes.renater.fr" "Voir: liste-hackesr" -macro index >H =liste-hackesr "save to liste-hackesr" -macro index /d "~C @lists.debian.org" "Voir: liste-Debian" macro index >D =liste-DEBIAN "save to liste-DEBIAN" -macro index /l "(~C @listes.upmc.fr|~C @services.cnrs.fr|~C @groupes.renater.fr|~C @pmichaud.com)" "Voir: Listes pro" +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" # get new messages by default @@ -138,6 +152,9 @@ 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 :" +# delete duplicate messages +folder-hook . push "~=" + # # headers # @@ -166,6 +183,25 @@ 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 #