익명 02:15

How to setup personal outlook account in Aerc?

How to setup personal outlook account in Aerc?

I'm using the Aerc mail client and I'm trying to setup my Personal outlook account on it. I'm also using the Oama authentication for OAuth and I want to know how to use it to avoid plaintext passwords.

My aerc config at /home/username/.config/aerc/accounts.conf looks like this:

[Personal]
source        = imaps://username%[email protected]:993
outgoing      = smtp://username%[email protected]:587
default       = INBOX
from          = Me <[email protected]>
copy-to       = Sent
cache-headers = true
source-cred-cmd   = echo PASSWORD
outgoing-cred-cmd = echo PASSWORD

But When I open aerc with this config, the authentication fails and I don't know why.

  • I have a legacy hotmail.com email address
  • I enabled IMAP on my Outlook settings

But I don't know how to configure a personal outlook email. I can configure my University's Office365 email, but this eludes me.

I also want to know how to edit source-cred-cmd and outgoing-cred-cmd to not echo my plaintext password



Top Answer/Comment:

For me, this is what worked: You will need an external application (oama, mutt_oauth2.py or other) to impersonate a known email client (Mozilla Thunderbird in this case) that can authenticate with the Outlook servers which then issue an authorization token, which aerc uses to receive/send emails with.

In summary:

Using this guide: Using aerc-mail with Outlook

  1. Download mutt_oauth2.py and place it in ~/.config/aerc.
  2. Modify line 78 of mutt_oauth2.py and replace the empty string with Mozilla Thunderbird's client ID so it becomes the following
'client_id': '9e5f94bc-e8a4-4e73-b8be-63364c29d753',
  1. Modify lines 48 and 49. The author of the guide opted to use tee.

"Now this isn’t ideal as these are live tokens that can be used on your account to send and receive email" (Werner, 2024)

ENCRYPTION_PIPE = ['tee']
DECRYPTION_PIPE = ['tee']
  1. Set-up a new account, and modify the configuration file (~/.config/aerc/accounts.conf), adding the *-cred-cmd
source            = imaps+xoauth2://your-email%[email protected]:993
outgoing          = smtp+xoauth2://your-email%[email protected]:587
default           = INBOX

source-cred-cmd   = "python3 ~/.config/aerc/mutt_oauth2.py ~/.config/aerc/[email protected]"
outgoing-cred-cmd = "python3 ~/.config/aerc/mutt_oauth2.py ~/.config/aerc/[email protected]"

There is also some useful info on the official wiki. Here they use oama to authenticate the user, this did not work for me. But using the mutt_oauth2.py script did.

References

  • Werner, L. (2024). Using aerc-mail with Outlook. Retrieved from https://lukaswerner.com/post/2024-07-08@aerc-outlook
상단 광고의 [X] 버튼을 누르면 내용이 보입니다