Forum > Networking and Web Programming

Integrating OAuth2 into email program

(1/3) > >>

QEnnay:
Hi, we have our own email client (Linux) developed in Lazarus (currently 2.2.2) over many years. It has been able to check our gmail accounts and download using the POP3/SMTP protocols.

As of May 30, gmail is using OAuth2 and blocking POP access. I been searching here and found some stuff on GitHub, but nothing so far that talks about converting from POP3 to OAuth2 for emails.

We may have to abandon gmail and that will suck. Our business originally used them and it would would be a mammoth task to inform a lot-lot-lot of customers of the new address via our own website URL.

When the POP3/SMTP was working we were able to wean them across no problem when we replied.

Can anyone point me in the right direction to try and get this changed over?

Thanks

Soner:
Which components are you using for sending and receiving emails, synapse, lnet or indy?

Search at google for "oauth2 lazarus". The user rvk and beni bela has some entries here, it helped me to send testmail in gmail with oauth2.
I wanted to publish my results here but I had not the time for it, maybe this weekend.
rvk's code uses google+ which is depracated, beni bela's code helps to understand the whole gmail oauth2.



rvk:

--- Quote from: QEnnay on June 24, 2022, 10:22:49 pm ---As of May 30, gmail is using OAuth2 and blocking POP access.

--- End quote ---
Really? I'm not aware of that. POP3 still works (and will continue to work).
What's blocked is SMTP with your gmail password.
But you can still use App passwords (if you have 2FA enabled).
So there is no real need to switch to OAuth2.

Just create an app password here and use it in your program.


--- Quote from: Soner on June 25, 2022, 12:20:50 am ---rvk's code uses google+ which is depracated,

--- End quote ---
My solution only uses the Gmail API.
So there is no need for the deprecated Google+.
My code still works (and is still in use).

Thaddy:
Rvk is right, he does not use G+. Also note that the OAUTH2 code in the google package should be enough and is default standard distribution.
You still need a - free - Key, though.

QEnnay:

--- Quote from: Soner on June 25, 2022, 12:20:50 am ---Which components are you using for sending and receiving emails, synapse, lnet or indy?

--- End quote ---

Thanks for an answer that perfectly matches the questions asked. Somewhat of a rarity these days. :)

We used Synapse, from memory, the "synalist r209-trunk" for TLS-1.3.

I will check out the rvk GitHub. I will also do a search here for Beni Bela  as I could not find a mention of OAuth on his web-pages.

Thanks again.

Navigation

[0] Message Index

[#] Next page

Go to full version