user:sachy:lakatux
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
user:sachy:lakatux [2023/02/04 17:52] – external edit 127.0.0.1 | user:sachy:lakatux [2023/03/23 17:03] – sachy | ||
---|---|---|---|
Line 985: | Line 985: | ||
View=%view{ascii} prettyjson.py %f 2>&1 | View=%view{ascii} prettyjson.py %f 2>&1 | ||
</ | </ | ||
+ | |||
+ | |||
+ | ===== mutt vs Oauth2 ===== | ||
+ | |||
+ | Oauth2 protocol is more and more popular auth mechanism, so mutt - as the least wrong mail client - have support too. Yet the support is a bit tricky... | ||
+ | |||
+ | First, download [[https:// | ||
+ | |||
+ | Then generate new PGP key for encryption of the Oauth secrets. "gpg --gen-key" | ||
+ | |||
+ | Edit the downloaded mutt_oauth2.py and change the following: | ||
+ | |||
+ | <code python> | ||
+ | ENCRYPTION_PIPE = [' | ||
+ | ... | ||
+ | ' | ||
+ | </ | ||
+ | |||
+ | If you want to use your own client_id, search faculty/ | ||
+ | |||
+ | Make first contact: | ||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | Follow the instructions, | ||
+ | |||
+ | Copy the whole URL to text editor and copy out the content of code= parameter back to the mutt_oauth2 prompt. Its long, invalid, base64 stuff ending prior "& | ||
+ | |||
+ | < | ||
+ | 0.AQIABsRF82hSsEOxn1hi-mgz-LyUX56k6HNOuL5j-LOTOFGARBAGE-REALLYLOTOFGARBAGE-EVENMOREGARBAGE-vUFlgHtUs6n5bmmRQgQ7AMH8zojnZWycMA | ||
+ | </ | ||
+ | |||
+ | Be sure not to copy newlines from vim/nano. Its one string, no newlines. NO NEWLINES! | ||
+ | |||
+ | If done correctly, the script will respond: | ||
+ | < | ||
+ | Exchanging the authorization code for an access token | ||
+ | NOTICE: Obtained new access token, expires 2023-03-23T12: | ||
+ | Access Token: lot-of-garbage | ||
+ | </ | ||
+ | |||
+ | Now is time to test the Oauth2 SMTP/IMAP connection: | ||
+ | < | ||
+ | $ / | ||
+ | Access Token: garbage... | ||
+ | IMAP authentication succeeded | ||
+ | POP authentication succeeded | ||
+ | SMTP authentication succeeded | ||
+ | </ | ||
+ | |||
+ | Good, the last thing is to edit the .mutt/ | ||
+ | |||
+ | <code muttrc> | ||
+ | set imap_user=" | ||
+ | set folder=" | ||
+ | set smtp_url=" | ||
+ | set imap_authenticators=" | ||
+ | set imap_oauth_refresh_command="/ | ||
+ | set smtp_authenticators=${imap_authenticators} | ||
+ | set smtp_oauth_refresh_command=${imap_oauth_refresh_command} | ||
+ | </ | ||
+ | |||
+ | If you have setup for more mailboxes, dont forget to clean the setting for all the others: | ||
+ | |||
+ | <code muttrc> | ||
+ | # reset Oauth2 to normal | ||
+ | set imap_authenticators=" | ||
+ | set imap_oauth_refresh_command="" | ||
+ | set smtp_authenticators=${imap_authenticators} | ||
+ | set smtp_oauth_refresh_command="" | ||
+ | </ | ||
+ | |||
+ | |||
user/sachy/lakatux.txt · Last modified: 2023/09/10 09:16 by sachy