From 99a78b8e7d6739ec872320430bc23f9c8742cd19 Mon Sep 17 00:00:00 2001 From: Bertrand Benjamin Date: Wed, 9 Nov 2022 06:58:25 +0100 Subject: [PATCH] Feat: neomutt config with external imap and smtp --- neomutt/.config/msmtp/config | 50 ++++++++ neomutt/.config/neomutt/accounts/ac-lyon | 51 +++++--- neomutt/.config/neomutt/accounts/bb_opytex | 51 +++++--- neomutt/.config/neomutt/accounts/jb_opytex | 44 +++++++ neomutt/.config/neomutt/colors | 115 ++++++++++++++--- neomutt/.config/neomutt/colors_gruvbox | 121 ++++++++++++++++++ neomutt/.config/neomutt/mailboxes | 1 + neomutt/.config/neomutt/mappings | 1 + neomutt/.config/neomutt/neomuttrc | 12 +- .../__pycache__/offlineimap.cpython-310.pyc | Bin 0 -> 350 bytes neomutt/.config/offlineimap/config | 67 ++++++++++ neomutt/.config/offlineimap/offlineimap.py | 5 + 12 files changed, 461 insertions(+), 57 deletions(-) create mode 100644 neomutt/.config/msmtp/config create mode 100644 neomutt/.config/neomutt/accounts/jb_opytex create mode 100644 neomutt/.config/neomutt/colors_gruvbox create mode 100644 neomutt/.config/neomutt/mailboxes create mode 100644 neomutt/.config/offlineimap/__pycache__/offlineimap.cpython-310.pyc create mode 100644 neomutt/.config/offlineimap/config create mode 100644 neomutt/.config/offlineimap/offlineimap.py diff --git a/neomutt/.config/msmtp/config b/neomutt/.config/msmtp/config new file mode 100644 index 0000000..b2ee2e0 --- /dev/null +++ b/neomutt/.config/msmtp/config @@ -0,0 +1,50 @@ +# Example for a user configuration file ~/.msmtprc + +# With modern mail services that publish autoconfiguration information, +# you can simply run 'msmtp --configure yourmail@example.com' to get +# a basic working configuration. + +# This example focusses on TLS and authentication. Features not used here +# include logging, timeouts, SOCKS proxies, TLS parameters, Delivery Status +# Notification (DSN) settings, and more. + +# Set default values: use the mail submission port 587, and always use TLS. +# On this port, TLS is activated via STARTTLS. +defaults +port 587 +tls on +tls_starttls on +auth on +tls_trust_file /etc/ssl/certs/ca-certificates.crt +logfile ~/.msmtp.log + +account bb_opytex + user Takanuva + passwordeval "pass mail/mailfence/Takanuva | head -n1" + auth on + host smtp.mailfence.com + port 465 + # Envelope-from address + from benjamin.bertrand@opytex.org + tls_starttls off + +account jb_opytex + user margot_benjamin + passwordeval "pass mail/jost_bertrand@opytex.org/margot_benjamin | head -n1" + auth on + host smtp.mailfence.com + port 465 + # Envelope-from address + from jost_bertrand@opytex.org + tls_starttls off + +account ac-lyon + user bbertrand + passwordeval "pass Prof/pronote/bbertrand | head -n1" + auth on + host smtps.ac-lyon.fr + # Envelope-from address + from benjamin.bertrand@ac-lyon.fr + +# Set a default account +account default : bb_opytex diff --git a/neomutt/.config/neomutt/accounts/ac-lyon b/neomutt/.config/neomutt/accounts/ac-lyon index 6b05d80..48261d2 100644 --- a/neomutt/.config/neomutt/accounts/ac-lyon +++ b/neomutt/.config/neomutt/accounts/ac-lyon @@ -1,26 +1,43 @@ # vim: filetype=muttrc unmailboxes * -set my_pass = "`pass Prof/pronote/bbertrand`" -set folder = "imaps://mail.ac-lyon.fr" -set imap_user = bbertrand -set imap_pass = $my_pass - -set ssl_force_tls = yes -set smtp_url = smtps://$imap_user@smtps.ac-lyon.fr:587 -set smtp_pass = $my_pass -set ssl_starttls = yes -set smtp_authenticators = "login" - set from = "benjamin.bertrand@ac-lyon.fr" -set spoolfile = +INBOX -mailboxes = +INBOX -set imap_check_subscribed +set sendmail = "/usr/bin/msmtp -a ac-lyon" +set folder = "~/.mail/ac_lyon" +set spoolfile = "+INBOX" +set postponed = "+Drafts" set record = "+Sent" set trash = "+Trash" -set postponed = "+Drafts" -## Hook -- IMPORTANT! -account-hook $folder "set imap_pass=`pass Prof/pronote/bbertrand`" +set mbox_type = Maildir +set ssl_starttls = yes +set ssl_force_tls = yes + +color status blue default + +#mailboxes =INBOX =Sent =Drafts =Junk + + +# set my_pass = "`pass Prof/pronote/bbertrand`" +# set folder = "imaps://mail.ac-lyon.fr" +# set imap_user = bbertrand +# set imap_pass = $my_pass +# +# set ssl_force_tls = yes +# set smtp_url = smtps://$imap_user@smtps.ac-lyon.fr:587 +# set smtp_pass = $my_pass +# set ssl_starttls = yes +# set smtp_authenticators = "login" +# +# set spoolfile = +INBOX +# mailboxes = +INBOX +# set imap_check_subscribed +# +# set record = "+Sent" +# set trash = "+Trash" +# set postponed = "+Drafts" +# +# ## Hook -- IMPORTANT! +# account-hook $folder "set imap_pass=`pass Prof/pronote/bbertrand`" diff --git a/neomutt/.config/neomutt/accounts/bb_opytex b/neomutt/.config/neomutt/accounts/bb_opytex index 06ed7a7..67325b7 100644 --- a/neomutt/.config/neomutt/accounts/bb_opytex +++ b/neomutt/.config/neomutt/accounts/bb_opytex @@ -1,26 +1,43 @@ # vim: filetype=muttrc unmailboxes * -set my_pass = "`pass mail/mailfence/Takanuva`" -set folder = "imaps://imap.mailfence.com/" -set imap_user = Takanuva -set imap_pass = $my_pass - -set ssl_force_tls = yes -set smtp_url = smtps://$imap_user@smtp.mailfence.com:465 -set smtp_pass = $my_pass -set ssl_starttls = yes -set smtp_authenticators = "login" - set from = "benjamin.bertrand@opytex.org" -set spoolfile = +INBOX -set imap_check_subscribed +set sendmail = "/usr/bin/msmtp -a bb_opytex" +set folder = "~/.mail/bb_opytex" -set record = "+Sent" -set trash = "+Trash" +set spoolfile = "+INBOX" set postponed = "+Drafts" +set record = "+Sent" +set trash = "+Junk" -## Hook -- IMPORTANT! -account-hook $folder "set imap_pass=`pass mail/mailfence/Takanuva`" +set mbox_type = Maildir +set ssl_starttls = yes +set ssl_force_tls = yes + +color status cyan default + +# mailboxes =INBOX =Sent =Drafts =Junk + +# set my_pass = "`pass mail/mailfence/Takanuva`" +# set folder = "imaps://imap.mailfence.com/" +# set imap_user = Takanuva +# set imap_pass = $my_pass +# +# set ssl_force_tls = yes +# set smtp_url = smtps://$imap_user@smtp.mailfence.com:465 +# set smtp_pass = $my_pass +# set ssl_starttls = yes +# set smtp_authenticators = "login" +# +# +# set spoolfile = +INBOX +# +# set record = "+Sent" +# set trash = "+Trash" +# set postponed = "+Drafts" +# +# +# ## Hook -- IMPORTANT! +# account-hook $folder "set imap_pass=`pass mail/mailfence/Takanuva`" diff --git a/neomutt/.config/neomutt/accounts/jb_opytex b/neomutt/.config/neomutt/accounts/jb_opytex new file mode 100644 index 0000000..3f59af7 --- /dev/null +++ b/neomutt/.config/neomutt/accounts/jb_opytex @@ -0,0 +1,44 @@ +# vim: filetype=muttrc +unmailboxes * +set imap_list_subscribed +set imap_check_subscribed + +set from = "jost_bertrand@opytex.org" + +set sendmail = "/usr/bin/msmtp -a jb_opytex" +set folder = "~/.mail/jb_opytex" + +set spoolfile = "+INBOX" +set postponed = "+Drafts" +set record = "+Sent" +set trash = "+Junk" + +set mbox_type = Maildir +set ssl_starttls = yes +set ssl_force_tls = yes + + +color status red default + +# set my_pass = "`pass mail/mailfence/Takanuva`" +# set folder = "imaps://imap.mailfence.com/" +# set imap_user = Takanuva +# set imap_pass = $my_pass +# +# set ssl_force_tls = yes +# set smtp_url = smtps://$imap_user@smtp.mailfence.com:465 +# set smtp_pass = $my_pass +# set ssl_starttls = yes +# set smtp_authenticators = "login" +# +# +# set spoolfile = +INBOX +# set imap_check_subscribed +# +# set record = "+Sent" +# set trash = "+Trash" +# set postponed = "+Drafts" +# +# +# ## Hook -- IMPORTANT! +# account-hook $folder "set imap_pass=`pass mail/mailfence/Takanuva`" diff --git a/neomutt/.config/neomutt/colors b/neomutt/.config/neomutt/colors index 39b16b2..87e2bfe 100644 --- a/neomutt/.config/neomutt/colors +++ b/neomutt/.config/neomutt/colors @@ -1,23 +1,100 @@ # -*-muttrc-*- -# Palette for use with the Linux console. Black background. +# Screenshot http://trovao.droplinegnome.org/stuff/mutt-zenburnt.png +# +# This is a zenburn-based neomutt color scheme that is not (even by far) +# complete. There's no copyright involved. Do whatever you want with it. +# Just be aware that I won't be held responsible if the current color-scheme +# explodes your mail client. ;) +# +# Do notice that this color scheme requires a terminal emulator that supports +# 256 color. Any modern X terminal emulator should have support for that and +# you can enable it by calling neomutt as "TERM=xterm-256color neomutt" or, if you +# use screen, by adding "term screen-256color" to your .screenrc. +# +# This file is in the public domain. +# -color hdrdefault blue black -color quoted blue black -color signature blue black -color attachment red black -color prompt brightmagenta black -color message brightred black -color error brightred black -color indicator black red -color status brightgreen blue -color tree white black -color normal white black -color markers red black -color search white black -color tilde brightmagenta black -color index blue black ~F -color index red black "~N|~O" +# general-doesn't-fit stuff +color normal color188 color237 +color error color115 color236 +color markers color142 color238 +color tilde color108 color237 +color status color144 color234 -# color body brightwhite black '\*+[^*]+\*+' -# color body brightwhite black '_+[^_]+_+' +# index stuff +color indicator color108 color236 +color tree color109 color237 +color index color188 color237 ~A +color index color188 color237 ~N +color index color188 color237 ~O +color index color174 color237 ~F +color index color174 color237 ~D + +# Message Index ---------------------------------------------------------------- + +## Weak +color index color08 color00 "~R" # read messages +color index color08 color00 "~d >45d" # older than 45 days +color index color08 color00 "~v~(!~N)" # collapsed thread with no unread +color index color08 color00 "~Q" # messages that have been replied to + +## Strong +color index color21 color00 "(~U|~N|~O)" # unread, new, old messages +color index color21 color00 "~v~(~U|~N|~O)" # collapsed thread with unread + +## Highlight +### Trusted +color index color06 color00 "~g" # PGP signed messages +color index color06 color00 "~G" # PGP encrypted messages +### Odd +color index color01 color00 "~E" # past Expires: header date +color index color01 color00 "~=" # duplicated +color index color01 color00 "~S" # marked by Supersedes: header +### Flagged +color index color05 color00 "~F" # flagged messages +color index color02 color00 "~v~(~F)" # collapsed thread with flagged inside + +# Selection +color index color02 color18 "~T" # tagged messages +color index color01 color18 "~D" # deleted messages + +# + +# header stuff +color hdrdefault color223 color237 +color header color223 color237 "^Subject" + +# gpg stuff +color body color188 color237 "^gpg: Good signature.*" +color body color115 color236 "^gpg: BAD signature.*" +color body color174 color237 "^gpg: Can't check signature.*" +color body color174 color237 "^-----BEGIN PGP SIGNED MESSAGE-----" +color body color174 color237 "^-----BEGIN PGP SIGNATURE-----" +color body color174 color237 "^-----END PGP SIGNED MESSAGE-----" +color body color174 color237 "^-----END PGP SIGNATURE-----" +color body color174 color237 "^Version: GnuPG.*" +color body color174 color237 "^Comment: .*" + +# url, email and web stuff +color body color174 color237 "(finger|ftp|http|https|news|telnet)://[^ >]*" +color body color174 color237 "" +color body color174 color237 "www\\.[-.a-z0-9]+\\.[a-z][a-z][a-z]?([-_./~a-z0-9]+)?" +color body color174 color237 "mailto: *[^ ]+\(\\i?subject=[^ ]+\)?" +color body color174 color237 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+" + +# misc body stuff +color attachment color174 color237 #Add-ons to the message +color signature color223 color237 + +# quote levels +color quoted color108 color237 +color quoted1 color116 color237 +color quoted2 color247 color237 +color quoted3 color108 color237 +color quoted4 color116 color237 +color quoted5 color247 color237 +color quoted6 color108 color237 +color quoted7 color116 color237 +color quoted8 color247 color237 +color quoted9 color108 color237 diff --git a/neomutt/.config/neomutt/colors_gruvbox b/neomutt/.config/neomutt/colors_gruvbox new file mode 100644 index 0000000..4a64c83 --- /dev/null +++ b/neomutt/.config/neomutt/colors_gruvbox @@ -0,0 +1,121 @@ +# -*-muttrc-*- +# gruvbox dark (contrast dark): + +# bg0 = 234 +# bg1 = 237 +# bg2 = 239 +# bg3 = 241 +# bg4 = 243 +# +# gray = 245 +# +# fg0 = 229 +# fg1 = 223 +# fg2 = 250 +# fg3 = 248 +# fg4 = 246 +# +# red = 167 +# green = 142 +# yellow = 214 +# blue = 109 +# purple = 175 +# aqua = 108 +# orange = 208 + + +# See http://www.mutt.org/doc/manual/#color + +color attachment color109 color234 +color bold color229 color234 +color error color167 color234 +color hdrdefault color246 color234 +color indicator color223 color237 +color markers color243 color234 +color normal color223 color234 +color quoted color250 color234 +color quoted1 color108 color234 +color quoted2 color250 color234 +color quoted3 color108 color234 +color quoted4 color250 color234 +color quoted5 color108 color234 +color search color234 color208 +color signature color108 color234 +color status color234 color250 +color tilde color243 color234 +color tree color142 color234 +color underline color223 color239 + +color sidebar_divider color250 color234 +color sidebar_new color142 color234 + +color index color142 color234 ~N +color index color108 color234 ~O +color index color109 color234 ~P +color index color214 color234 ~F +color index color175 color234 ~Q +color index color167 color234 ~= +color index color234 color223 ~T +color index color234 color167 ~D + +color header color214 color234 "^(To:|From:)" +color header color142 color234 "^Subject:" +color header color108 color234 "^X-Spam-Status:" +color header color108 color234 "^Received:" + +# Regex magic for URLs and hostnames +# +# Attention: BSD's regex has RE_DUP_MAX set to 255. +# +# Examples: +# http://some-service.example.com +# example.com +# a.example.com +# some-service.example.com +# example.com/ +# example.com/datenschutz +# file:///tmp/foo +# +# Non-examples: +# 1.1.1900 +# 14.02.2022/24:00 +# 23.59 +# w.l.o.g +# team.its +color body color142 color234 "[a-z]{3,255}://[[:graph:]]*" +color body color142 color234 "([-[:alnum:]]+\\.)+([0-9]{1,3}|[-[:alpha:]]+)/[[:graph:]]*" +color body color142 color234 "([-[:alnum:]]+\\.){2,255}[-[:alpha:]]{2,10}" + +# IPv4 and IPv6 stolen from https://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses +color body color142 color234 "((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])" +color body color142 color234 "(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\\\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))" + +# Mail addresses and mailto URLs +color body color208 color234 "[-a-z_0-9.%$]+@[-a-z_0-9.]+\\.[-a-z][-a-z]+" +color body color208 color234 "mailto:[-a-z_0-9.]+@[-a-z_0-9.]+" + +# some simleys and stuff +color body color234 color214 "[;:]-*[)>( complete-query ## Shortcuts macro index,pager 'source ~/.config/neomutt/accounts/ac-lyon!' macro index,pager 'source ~/.config/neomutt/accounts/bb_opytex!' +macro index,pager 'source ~/.config/neomutt/accounts/jb_opytex!' diff --git a/neomutt/.config/neomutt/neomuttrc b/neomutt/.config/neomutt/neomuttrc index 7b4ff68..a921071 100644 --- a/neomutt/.config/neomutt/neomuttrc +++ b/neomutt/.config/neomutt/neomuttrc @@ -1,11 +1,15 @@ # vim: filetype=muttrc source ~/.config/neomutt/settings -source ~/.config/neomutt/colors +source ~/.config/neomutt/colors_gruvbox source ~/.config/neomutt/mappings +#source ~/.config/neomutt/accounts/jb_opytex +folder-hook jb_opytex/* 'source ~/.config/neomutt/accounts/jb_opytex' +#source ~/.config/neomutt/accounts/bb_opytex +folder-hook bb_opytex/* 'source ~/.config/neomutt/accounts/bb_opytex' source ~/.config/neomutt/accounts/ac-lyon -folder-hook $folder 'source ~/.config/neomutt/accounts/ac-lyon' -source ~/.config/neomutt/accounts/bb_opytex -folder-hook $folder 'source ~/.config/neomutt/accounts/bb_opytex' +folder-hook ac_lyon/* 'source ~/.config/neomutt/accounts/ac-lyon' + +#source ~/.config/neomutt/mailboxes diff --git a/neomutt/.config/offlineimap/__pycache__/offlineimap.cpython-310.pyc b/neomutt/.config/offlineimap/__pycache__/offlineimap.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..47f1d5e1d971472f554029191c6ed5f3d0de8666 GIT binary patch literal 350 zcmYk0y-ve05XaB?fT&7m%GNbY!vjEjJ#4-CSHMw zJBuMF-IwqD`=41Z7l5`tH2f9wH#Kuhu(?I|D+~ez(=f0jV;~ZdzQHjO*#WBj2d7Z6 zspP%nkBu3F9Rp|d`fpTc=y&K577+FVR}u7{e6UXt*)