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

2020-08-11 Thread Marcelo Laia
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 mylo...@yzyzyz.edu.br
port 587
protocol smtp
tls on
tls_trust_file /etc/ssl/certs/ca-certificates.crt
auth oauthbearer
user mylo...@yzyzyz.edu.br
passwordeval /home/myuser/.oauth2token mylo...@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 
mylo...@yzyzyz.edu.br YZYZYZ"

Please, someone have a clue to solve this?

Thank you!

-- 
Marcelo


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

2020-08-11 Thread Will Yardley
On Tue, Aug 11, 2020 at 10:01:43AM -0300, Marcelo Laia wrote:
> 
> There are some way to connect offlineimap and msmtp, and so on mutt, in
> this authentication way?

If you can create an "app password", it's relatively easy.
https://support.google.com/accounts/answer/185833?hl=en

If your org won't let you do this, you may need to use the external
hooks for OAUTH2 auth.

w



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

2020-08-11 Thread Hokan
I use Mutt with Gmail and it works well, but was fiddly to set up.

Somebody wrote a blog post on how to do it:

https://luxing.im/mutt-integration-with-gmail-using-oauth/


On Tue, Aug 11, 2020 at 10:01:43AM -0300, Marcelo Laia wrote:
> Hi,
> 
> My Institution migrate the e-mail server to G-Suite Gmail.
> 
> So, the IMAP connection to institutional e-mail server go away.
> 
> Now, we access Gmail at https://mail.google.com and enter our full
> login, like this:
> 
> myloginn...@myinstitutiondomain.edu.br
> 
> and click next. So, it's redirected to a login domain, like this:
> 
> https://x.myinstitutiondomain.edu.br/.php//999pass.php?AuthState=bb523%3Ahttps%3A%2F%2Fx.myinstitutiondomain.edu.br%2Fsaml2%2Fidp%2FSSOS.php%3Fsid%3Dgoogle.com%252Fa%252Fmyinstitutiondomain.edu.br%26cookieTime%3XX%26RelayState%3Dhttps%253A%252F%252Faccounts.google.com%252FCheckCookie%253Fcontinue%253Dhttps%25253A%25252F%25252Fmail.google.com%25252Fmail%25252F%2526service%253Dmail%2526ss%253D1%2526scc%253D1%2526rm%253Dfalse%2526osid%253D1%2526ltmpl%253Ddefaultzzz
> 
> We need to enter our login name again and our password, in a form, like
> this:
> 
> myloginname (field 1)
> mypassword  (field 2)
> 
> and click next.
> 
> There are some way to connect offlineimap and msmtp, and so on mutt, in
> this authentication way?
 
-- 
Hokan
Bicyclist
Sysadmin


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

2020-08-11 Thread Marcelo Laia
Hi,

My Institution migrate the e-mail server to G-Suite Gmail.

So, the IMAP connection to institutional e-mail server go away.

Now, we access Gmail at https://mail.google.com and enter our full
login, like this:

myloginn...@myinstitutiondomain.edu.br

and click next. So, it's redirected to a login domain, like this:

https://x.myinstitutiondomain.edu.br/.php//999pass.php?AuthState=bb523%3Ahttps%3A%2F%2Fx.myinstitutiondomain.edu.br%2Fsaml2%2Fidp%2FSSOS.php%3Fsid%3Dgoogle.com%252Fa%252Fmyinstitutiondomain.edu.br%26cookieTime%3XX%26RelayState%3Dhttps%253A%252F%252Faccounts.google.com%252FCheckCookie%253Fcontinue%253Dhttps%25253A%25252F%25252Fmail.google.com%25252Fmail%25252F%2526service%253Dmail%2526ss%253D1%2526scc%253D1%2526rm%253Dfalse%2526osid%253D1%2526ltmpl%253Ddefaultzzz

We need to enter our login name again and our password, in a form, like
this:

myloginname (field 1)
mypassword  (field 2)

and click next.

There are some way to connect offlineimap and msmtp, and so on mutt, in
this authentication way?

Thank you!

-- 
Marcelo