Migrating GMail to Dovecot using imapc
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=user@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>
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=user@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-leave@dovecot.org
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=user@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-leave@dovecot.org
Sure, would be nice. I guess it would be best to put it to the migration page.
Aki
On 18/11/2024 13:23 EET Jan Naumann via dovecot dovecot@dovecot.org wrote:
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=user@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-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
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!
For me, I don't want big tech monitoring my emails.
On 18/11/2024 11:52, Marc via dovecot wrote:
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
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!
dovecot mailing list --dovecot@dovecot.org To unsubscribe send an email todovecot-leave@dovecot.org
Yes that is for me also. However I have the impression that this is becoming a smaller group (fast). I have clients that are doing even 'innovative' things and are moving to the outlook cloud. These big clouds are just adding more new features and are creating a more integrated environment that is quite appealing to users.
For me, I don't want big tech monitoring my emails.
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
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 youOn 18/11/2024 11:52, Marc via dovecot wrote: point
me in the right direction? Thank you in advance!
dovecot mailing list --dovecot@dovecot.org To unsubscribe send an email todovecot-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 18.11.24 12:52, Marc wrote:
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
Oh, I am using dovecot for years as my primary (private) mail. Even the company I am working for is still using dovecot/exim (besides Exchange for the administration). The GMail account in question is an old one I just want to migrate now. Never used it as primary mail.
Why am I using dovecot? There are several issues I have with the services big tech offers:
Full control over my mail and not depending on a big tech company to decide what my quota is (or if I have to use some paid plan to get feature X), if the service is shut down at some future point, what AI models are trained on my messages, ...
Data protection: If another person/a tech company do not need to see my data/message, why should they? Sure, there a E2E encryption solutions as SMIME/PGP, but this works only with your tech-affine friends and do not protect unencrypted incoming mail from being monitored.
Standard (RFC) compliance. It is way to annoying to work around the specialities of Exchange/Google/... if you using mail for e.g. stuff like sending git patches to open source projects. Just try to send a mail over an Exchange relay without it is destroying the (valid) From-header field ;)
Flexibility of my mail setup. I want to have some alias which is forwarded to my main inbox but is archived in a separate mailbox shared with another person. Sure, just setup a second mailbox in dovecot and tell postfix how to handle the virtual mail address. Tasks like that are flexible to solve with a MTA/dovecot setup. Sure, you likely can do that with the big providers as well, but I am sure that there is sometimes a long way you have to go to solve some problems
Anyway, I am a big fan of dovecot and am very happy that this still available as solution while the big crowd is converting to Google/Microsoft.
Best, Jan
Not everyone. The EU is pushing hard for data to stay local. MS/Google will do what they know best: offer 0 support even to paying customers and jack up the prices once the competition dries up.
There will always be alternatives.
Scott
On Monday, 18/11/2024 at 06:52 Marc via dovecot wrote:
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
I try to migrate a GMail mailbox to Dovecot using
doveadm backup -R imapc:
. Since it seems that GMail disabled the login without
cannot figure out how to authenticate dovecot to GMail. Could you
XOAUTH2, I point
me in the right direction? Thank you in advance!
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
Not everyone. The EU is pushing hard for data to stay local. MS/Google will do what they know best: offer 0 support even to paying customers and jack up the prices once the competition dries up.
You have already MS / Google data centres in the EU. And Apple is using European registered/located ip ranges for this safe browsing, what actually means give to Apple everything you visit.
There will always be alternatives.
Is that not contradictory to your "competition dries up"? If you look at the last 15 years I do not have the impression alternatives kept their market shares.
Data centres in the EU is not enough to ensure data stays local.
https://www.edps.europa.eu/press-publications/press-news/press-releases/2024...
As far as I know, the EU is pushing hard for alternatives to relying on US companies for all their needs.
For my second comment, yes competition will dry up but not disappear completely. And as soon as they go too far, alternatives will pop up.
Not to mention that they inevitably have huge drawbacks due to their (growing) size: MS365 and Google are responsible for a huge chunk of Spam and they don't even bother to block their outbound Spam, effectively strong-arming others to whitelist their ranges. So assuming they gain even more market share, all that Spam will stay internal to their network. Basically spamming and phishing their own customers to death because of their inadequate policies.
Finally I might add that the only real contender for e-mail is MS. Google is getting dumped as well in the enterprise space because their offer doesn't measure up to MS365.
Cheers,
Scott
On Monday, 18/11/2024 at 15:35 Marc via dovecot wrote:
Not everyone. The EU is pushing hard for data to stay local.
MS/Google
will do what they know best: offer 0 support even to paying customers and jack up the prices once the competition dries up.
You have already MS / Google data centres in the EU. And Apple is using European registered/located ip ranges for this safe browsing, what actually means give to Apple everything you visit.
There will always be alternatives.
Is that not contradictory to your "competition dries up"? If you look at the last 15 years I do not have the impression alternatives kept their market shares.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
On 11/18/24 16:04, Scott Q. via dovecot wrote:
As far as I know, the EU is pushing hard for alternatives to relying on US companies for all their needs.
FWIW, the eight or nine remaining smart people in the US are also pushing hard for alternatives to relying on US companies for all their needs!
-Dave
-- Dave McGuire, AK4HZ New Kensington, PA
On Mon, Nov 18, 2024 at 09:21:08AM -0500, Scott Q. via dovecot wrote:
Not everyone. The EU is pushing hard for data to stay local. MS/Google will do what they know best: offer 0 support even to paying customers and jack up the prices once the competition dries up.
???
There will always be alternatives.
???
Scott???
Microsft outlook and Google Gmail hosts most spammers on the Planet Earth.
On Monday, 18/11/2024 at 06:52 Marc via dovecot wrote:
Sorry for being off topic, but why are you deciding to move to dovecot? I have the impression the trend is that everyone is moving to google/outlook?
I try to migrate a GMail mailbox to Dovecot using
doveadm backup -R imapc:
. Since it seems that GMail disabled the login withoutcannot figure out how to authenticate dovecot to GMail. Could you
XOAUTH2, I point
me in the right direction? Thank you in advance!
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
-- Member - Liberal International This is doctor@nk.ca Ici doctor@nk.ca Yahweh, King & country!Never Satan President Republic!Beware AntiChrist rising! Look at Psalms 14 and 53 on Atheism ; Nova Scotia Vote Liberal!
(I forget who the original poster was.)
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!
I just did this for my alpine mail reader, and it's not so simple. It may be simpler to use a mail reader that has XOAUTH2 built in, then connect to both Gmail and your mail account, then drag and drop all your mailboxes.
If you want to do it the hard way, the document for alpine might be useful for a single Gmail account, at least to set up the Gmail end.
https://alpineapp.email/alpine/alpine-info/misc/xoauth2.html#SettingUpGmail
After that, you have to do some rigamrole to use these IDs to create the credentials you can use for IMAP authentication.
(Applicable only for alpine but show the interaction)
https://alpineapp.email/alpine/alpine-info/misc/AuthorizeAlpineGmail.html
Good luck. Joseph Tam jtam.home@gmail.com
participants (9)
-
Aki Tuomi
-
Benny Pedersen
-
Dave McGuire
-
Jan Naumann
-
Joseph Tam
-
Marc
-
Nick Howitt
-
Scott Q.
-
The Doctor