From 37569e2c619942c36b0910a5833abb4f765c1464 Mon Sep 17 00:00:00 2001 From: Timo Wilken Date: Thu, 20 Apr 2023 14:53:36 +0200 Subject: Split work and home aerc configs apart --- tw/home/cern.scm | 6 +++- tw/home/files/aerc/accounts.conf | 52 ++++++++++++++++++++++++++++++++--- tw/home/files/aerc/accounts.work.conf | 20 ++++++++++++++ tw/home/lap.scm | 6 +++- 4 files changed, 78 insertions(+), 6 deletions(-) create mode 100644 tw/home/files/aerc/accounts.work.conf diff --git a/tw/home/cern.scm b/tw/home/cern.scm index 674f0927..2957fd8b 100644 --- a/tw/home/cern.scm +++ b/tw/home/cern.scm @@ -47,7 +47,11 @@ (simple-service 'pim-config home-xdg-configuration-files-service-type `(("khal/config" ,(local-file "files/khal.conf")) ("khard/khard.conf" ,(local-file "files/khard.conf")) - ("aerc" ,(local-file "files/aerc" #:recursive? #t)) + ("aerc/accounts.conf" ,(local-file "files/aerc/accounts.work.conf")) + ("aerc/aerc.conf" ,(local-file "files/aerc/aerc.conf")) + ("aerc/binds.conf" ,(local-file "files/aerc/binds.conf")) + ("aerc/filters" ,(local-file "files/aerc/filters" #:recursive? #t)) + ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)) ("vdirsyncer/config" ,(local-file "files/vdirsyncer.conf")))) ;; These cron jobs are annoying because they pop up a password prompt every time they run. diff --git a/tw/home/files/aerc/accounts.conf b/tw/home/files/aerc/accounts.conf index 469c912e..53220cc9 100644 --- a/tw/home/files/aerc/accounts.conf +++ b/tw/home/files/aerc/accounts.conf @@ -1,15 +1,26 @@ +[Mythic Beasts] +source = imaps://timo%40twilken.net@oncilla.mythic-beasts.com +outgoing = smtps+plain://timo%40twilken.net@smtp-auth.mythic-beasts.com +source-cred-cmd = pass www/mythic-beasts/email/timo | head -1 +outgoing-cred-cmd = pass www/mythic-beasts/email/timo | head -1 +default = INBOX +from = Timo Wilken +copy-to = Sent +postpone = Drafts +cache-headers = true + [CERN] # https://man.sr.ht/~rjarry/aerc/providers/microsoft.md#office365-with-xoauth2 source = imaps+xoauth2://timo.wilken%40cern.ch@outlook.office365.com?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access outgoing = smtp+xoauth2://timo.wilken%40cern.ch@smtp.office365.com:587?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access -smtp-starttls = yes +smtp-starttls = true # To authorize for the first time (to get refresh token): -# mutt_oauth2.py ~/.local/share/aerc/twilken.tokens --authorize --authflow authcode --provider microsoft \ +# mutt_oauth2.py ~/.local/share/aerc/cern.tokens --authorize --authflow authcode --provider microsoft \ # --email timo.wilken@cern.ch --client-id 9e5f94bc-e8a4-4e73-b8be-63364c29d753 --client-secret '' \ -# --encryption-pipe 'gpg --encrypt --recipient C2249BBE5E8761C943A0CFA1B7B3914BF63ACD7C' +# --encryption-pipe 'gpg --encrypt --recipient timo@twilken.net' # Confirm empty client secret. When done, copy-paste ?code= value from final URL to the command-line. # Then, to store the refresh token: -# gpg --decrypt ~/.local/share/aerc/twilken.tokens | jq -r .refresh_token | pass insert -e -f cern/exol/refresh-token +# gpg --decrypt ~/.local/share/aerc/cern.tokens | jq -r .refresh_token | pass insert -e -f cern/exol/refresh-token source-cred-cmd = pass cern/exol/refresh-token outgoing-cred-cmd = pass cern/exol/refresh-token default = INBOX @@ -18,3 +29,36 @@ aliases = twilken@cern.ch copy-to = Sent Items postpone = Drafts cache-headers = true + +[Gmail] +source = imaps://timo.21.wilken%40gmail.com@imap.gmail.com +outgoing = smtps+login://timo.21.wilken%40gmail.com@smtp.gmail.com +source-cred-cmd = pass www/google/app-passwords/mutt | head -1 +outgoing-cred-cmd = pass www/google/app-passwords/mutt | head -1 +default = INBOX +from = Timo Wilken +copy-to = [Gmail]/Sent Mail +postpone = [Gmail]/Drafts +cache-headers = true + +[Cantab] +source = imaps+xoauth2://tw466%40cantab.ac.uk@outlook.office365.com +outgoing = smtps+xoauth2://tw466%40cantab.ac.uk@smtp-mail.outlook.com +source-cred-cmd = mutt_oauth2.py --encryption-pipe='gpg --encrypt --recipient timo@twilken.net' "$XDG_DATA_HOME/neomutt/cantab.gpg" +outgoing-cred-cmd = mutt_oauth2.py --encryption-pipe='gpg --encrypt --recipient timo@twilken.net' "$XDG_DATA_HOME/neomutt/cantab.gpg" +default = INBOX +from = Timo Wilken +copy-to = Sent Items +postpone = Drafts +cache-headers = true + +[Outlook] +source = imaps+xoauth2://timo_wilken%40live.co.uk@outlook.office365.com +outgoing = smtps+xoauth2://timo_wilken%40live.co.uk@smtp-mail.outlook.com +source-cred-cmd = mutt_oauth2.py --encryption-pipe='gpg --encrypt --recipient timo@twilken.net' "$XDG_DATA_HOME/neomutt/outlook.gpg" +outgoing-cred-cmd = mutt_oauth2.py --encryption-pipe='gpg --encrypt --recipient timo@twilken.net' "$XDG_DATA_HOME/neomutt/outlook.gpg" +default = INBOX +from = Timo Wilken +copy-to = Sent +postpone = Drafts +cache-headers = true diff --git a/tw/home/files/aerc/accounts.work.conf b/tw/home/files/aerc/accounts.work.conf new file mode 100644 index 00000000..469c912e --- /dev/null +++ b/tw/home/files/aerc/accounts.work.conf @@ -0,0 +1,20 @@ +[CERN] +# https://man.sr.ht/~rjarry/aerc/providers/microsoft.md#office365-with-xoauth2 +source = imaps+xoauth2://timo.wilken%40cern.ch@outlook.office365.com?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access +outgoing = smtp+xoauth2://timo.wilken%40cern.ch@smtp.office365.com:587?client_id=9e5f94bc-e8a4-4e73-b8be-63364c29d753&token_endpoint=https://login.microsoftonline.com/common/oauth2/v2.0/token&scope=https://outlook.office.com/SMTP.Send https://outlook.office.com/IMAP.AccessAsUser.All offline_access +smtp-starttls = yes +# To authorize for the first time (to get refresh token): +# mutt_oauth2.py ~/.local/share/aerc/twilken.tokens --authorize --authflow authcode --provider microsoft \ +# --email timo.wilken@cern.ch --client-id 9e5f94bc-e8a4-4e73-b8be-63364c29d753 --client-secret '' \ +# --encryption-pipe 'gpg --encrypt --recipient C2249BBE5E8761C943A0CFA1B7B3914BF63ACD7C' +# Confirm empty client secret. When done, copy-paste ?code= value from final URL to the command-line. +# Then, to store the refresh token: +# gpg --decrypt ~/.local/share/aerc/twilken.tokens | jq -r .refresh_token | pass insert -e -f cern/exol/refresh-token +source-cred-cmd = pass cern/exol/refresh-token +outgoing-cred-cmd = pass cern/exol/refresh-token +default = INBOX +from = Timo Wilken +aliases = twilken@cern.ch +copy-to = Sent Items +postpone = Drafts +cache-headers = true diff --git a/tw/home/lap.scm b/tw/home/lap.scm index 7b49be9b..7ffa3974 100644 --- a/tw/home/lap.scm +++ b/tw/home/lap.scm @@ -51,7 +51,11 @@ (simple-service 'pim-config home-xdg-configuration-files-service-type `(("khal/config" ,(local-file "files/khal.conf")) ("khard/khard.conf" ,(local-file "files/khard.conf")) - ("aerc" ,(local-file "files/aerc" #:recursive? #t)) + ("aerc/accounts.conf" ,(local-file "files/aerc/accounts.conf")) + ("aerc/aerc.conf" ,(local-file "files/aerc/aerc.conf")) + ("aerc/binds.conf" ,(local-file "files/aerc/binds.conf")) + ("aerc/filters" ,(local-file "files/aerc/filters" #:recursive? #t)) + ("aerc/stylesets" ,(local-file "files/aerc/stylesets" #:recursive? #t)) ("mutt/muttrc" ,(local-file "files/muttrc")) ("mutt/catppuccin.muttrc" ,catppuccin-muttrc) ("newsboat/config" ,(local-file "files/newsboat.conf")) -- cgit v1.2.3