Thank you very much! Did not know that there is this nice playground.

Do you think it would be fine that I will prepare a pull request for the documentation later to add this information for future reference? For me it was not clear that `imapc_password` would be the right place to provide the access/bearer token.

Best,
Jan

On 18.11.24 12:12, Aki Tuomi wrote:
For single account migration you can use google playground to get a token,

https://developers.google.com/oauthplayground/

just make sure it has the right scope(s) to work. You need the "bearer token".

Then you can do

doveadm -o imapc_password=<token here> -o imapc_sasl_mechanism=xoauth2 ... sync

Aki

On 18/11/2024 13:01 EET Jan Naumann via dovecot <dovecot@dovecot.org> wrote:

Dear Dovecot community,

I try to migrate a GMail mailbox to Dovecot using `doveadm backup -R
imapc:`. Since it seems that GMail disabled the login without XOAUTH2, I
cannot figure out how to authenticate dovecot to GMail. Could you point
me in the right direction? Thank you in advance!

Best regards,
Jan


Here the commands and config I am using:

# dovecot --version
2.3.19.1 (9b53102964)


# doveadm -D -c gmail.conf backup -R -u user-gmail imapc:


# cat gmail.conf
!include /etc/dovecot/dovecot.conf

imapc_host=imap.gmail.com
imapc_port=993
imapc_ssl=imaps
imapc_features=rfc822.size fetch-headers gmail-migration
mail_prefetch_count=20

imapc_sasl_mechanisms=XOAUTH2 OAUTHBEARER PLAIN

rawlog_dir = /tmp/rawlog
imapc_rawlog_dir = /tmp/rawlog

imapc_user=u...@googlemail.com
imapc_password=pw


# cat /tmp/rawlog/20241118-114553.246444.1.in
1731926753.488821 * OK Gimap ready for requests from <ip> <base64>
1731926753.503819 * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA
ID XLIST CHILDREN X-GM-EXT-1 XYZZY SASL-IR AUTH=XOAUTH2 AUTH=PLAIN
AUTH=PLAIN-CLIENTTOKEN AUTH=OAUTHBEARER
1731926753.503819 1 OK Thats all she wrote! <base64>
1731926753.806967 + <base64>


# cat /tmp/rawlog/20241118-114553.246444.1.out
1731926753.488935 1 CAPABILITY
1731926753.504048 2 AUTHENTICATE XOAUTH2 <base64>


_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

_______________________________________________
dovecot mailing list -- dovecot@dovecot.org
To unsubscribe send an email to dovecot-le...@dovecot.org

Reply via email to