IMAP authentication in one domain (my institution) and redirect to Gmail

Marcelo Laia marcelolaia at gmail.com
Wed Aug 12 01:27:42 UTC 2020


On 11/08/20 at 08:14, Hokan wrote:
> 
> Somebody wrote a blog post on how to do it:
> 
> https://luxing.im/mutt-integration-with-gmail-using-oauth/
> 

Hi,

Thank you so much! It save my day. With your post, I could found more
information, because I use mutt+offlineimap+msmtp

Offlineimap is run out of the box with OAuth2! A beautiful!

But, msmtp is so hard to configure!

I found this:

https://github.com/tenllado/dotfiles/tree/master/config/msmtp

I set up the system's keyring like this:

secret-tool store --label=msmtp-oauth2 client-id client-id
Password:

I copy and paste the "OAuth client ID" in the password prompt above.

secret-tool store --label=msmtp-oauth2 client-secret client-secret
Password:

I copy and paste the "Secret" in the password prompt above.

secret-tool store --label=msmtp-oauth2 refresh refresh
Password:

I copy and paste the "Refresh Token" in the password prompt above.

Is this OK?

My msmtprc is like this:

account YZYZYZ
host smtp.gmail.com
from mylogin at YZYZYZ.edu.br
port 587
protocol smtp
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth oauthbearer
user mylogin at YZYZYZ.edu.br
passwordeval /home/myuser/.oauth2token mylogin at YZYZYZ.edu.br YZYZYZ

However, when I try to send a message, I got:

sh: 1: /home/myuser/.oauth2token: Permission denied
msmtp: was not possible to read the stdout from "/home/myuser/.oauth2token mylogin at YZYZYZ.edu.br YZYZYZ"

Please, someone have a clue to solve this?

Thank you!

-- 
Marcelo


More information about the Mutt-users mailing list