From d497cdb3431d6e8e440c4c11e36f3375299aab41 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Sun, 11 Dec 2022 17:19:16 +0100 Subject: Enable XOAUTH2 authentication for ExOL accounts --- muttrc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'muttrc') diff --git a/muttrc b/muttrc index f0419b72..e17a467a 100644 --- a/muttrc +++ b/muttrc @@ -70,6 +70,7 @@ auto_view text/html image/jpeg image/png set allow_ansi set my_mythic = "imaps://oncilla.mythic-beasts.com/" +account-hook "$my_mythic" 'unmailboxes *' account-hook "$my_mythic" 'set folder = "$my_mythic"' account-hook "$my_mythic" 'set smtp_url = "smtps://smtp-auth.mythic-beasts.com"' account-hook "$my_mythic" 'set imap_user = "timo@twilken.net"' @@ -83,6 +84,7 @@ account-hook "$my_mythic" 'set from = "$imap_user"' account-hook "$my_mythic" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators imap_authenticators imap_oauth_refresh_command' set my_cern = "imaps://imap.cern.ch/" +account-hook "$my_cern" 'unmailboxes *' account-hook "$my_cern" 'set folder = "$my_cern"' account-hook "$my_cern" 'set smtp_url = "smtp://smtp.cern.ch:587"' # we need to rely on STARTTLS account-hook "$my_cern" 'set imap_user = "twilken"' @@ -90,6 +92,7 @@ account-hook "$my_cern" 'set smtp_user = "twilken"' account-hook "$my_cern" 'set imap_pass = `pass cern/sso | head -1`' account-hook "$my_cern" 'set smtp_pass = `pass cern/sso | head -1`' account-hook "$my_cern" 'set smtp_authenticators = "login"' # only LOGIN supported, not even PLAIN +account-hook "$my_cern" "alternates '^timo\.wilken@cern\.ch$' '^twilken@cern\.ch$'" account-hook "$my_cern" 'set spool_file = +INBOX' account-hook "$my_cern" 'set postponed = +Drafts' account-hook "$my_cern" 'set record = "+Sent Items"' @@ -98,6 +101,7 @@ account-hook "$my_cern" 'set ssl_use_tlsv1 ssl_use_tlsv1_1' # imap.cern.ch nee account-hook "$my_cern" 'reset imap_authenticators imap_oauth_refresh_command' set my_gmail = "imaps://imap.gmail.com/" +account-hook "$my_gmail" 'unmailboxes *' account-hook "$my_gmail" 'set folder = "$my_gmail"' account-hook "$my_gmail" 'set smtp_url = "smtps://smtp.gmail.com"' account-hook "$my_gmail" 'set imap_user = "timo.21.wilken@gmail.com"' @@ -113,6 +117,7 @@ account-hook "$my_gmail" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticator # ExOl needs OAUTH now! # https://neomutt.org/guide/optionalfeatures.html#oauth set my_cantab = "imaps://tw466@cantab.ac.uk@outlook.office365.com/" +account-hook "$my_cantab" 'unmailboxes *' account-hook "$my_cantab" 'set folder = "$my_cantab"' account-hook "$my_cantab" 'set smtp_url = "smtp://smtp-mail.outlook.com:587"' account-hook "$my_cantab" 'set imap_user = "tw466@cantab.ac.uk"' @@ -124,11 +129,11 @@ account-hook "$my_cantab" 'set postponed = +Drafts' account-hook "$my_cantab" 'set record = +Sent' account-hook "$my_cantab" 'set from = "$imap_user"' account-hook "$my_cantab" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators' -account-hook "$my_cantab" 'set imap_authenticators = "oauthbearer:xoauth2"' -# TODO: replace YOUR_GPG_IDENTITY string in mutt_oauth2.py. -account-hook "$my_cantab" 'set imap_oauth_refresh_command = "python3 ~/.guix-home/profile/share/doc/neomutt/oauth2/mutt_oauth2.py ~/.local/share/neomutt/cantab.gpg"' +account-hook "$my_cantab" 'set imap_authenticators = "xoauth2"' +account-hook "$my_cantab" 'set imap_oauth_refresh_command = "mutt_oauth2.py --encryption-pipe=\"gpg --encrypt --recipient timo@twilken.net\" $XDG_DATA_HOME/neomutt/cantab.gpg"' set my_outlook = "imaps://timo_wilken@live.co.uk@outlook.office365.com/" +account-hook "$my_outlook" 'unmailboxes *' account-hook "$my_outlook" 'set folder = "$my_outlook"' account-hook "$my_outlook" 'set smtp_url = "smtp://smtp-mail.outlook.com:587"' account-hook "$my_outlook" 'set imap_user = "timo_wilken@live.co.uk"' @@ -140,9 +145,8 @@ account-hook "$my_outlook" 'set postponed = +Drafts' account-hook "$my_outlook" 'set record = +Sent' account-hook "$my_outlook" 'set from = "$imap_user"' account-hook "$my_outlook" 'reset ssl_use_tlsv1 ssl_use_tlsv1_1 smtp_authenticators' -account-hook "$my_cantab" 'set imap_authenticators = "oauthbearer:xoauth2"' -# TODO: replace YOUR_GPG_IDENTITY string in mutt_oauth2.py. -account-hook "$my_cantab" 'set imap_oauth_refresh_command = "python3 ~/.guix-home/profile/share/doc/neomutt/oauth2/mutt_oauth2.py ~/.local/share/neomutt/outlook.gpg"' +account-hook "$my_outlook" 'set imap_authenticators = "xoauth2"' +account-hook "$my_outlook" 'set imap_oauth_refresh_command = "mutt_oauth2.py --encryption-pipe=\"gpg --encrypt --recipient timo@twilken.net\" $XDG_DATA_HOME/neomutt/outlook.gpg"' macro index,pager gm "set folder=$my_mythic+INBOX" "Switch to Mythic Beasts account" macro index,pager gG "set folder=$my_gmail+INBOX" "Switch to Gmail account" -- cgit v1.2.3