Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
TIdIMAP4::RetrieveHeader speed
#7
(06-25-2022, 10:58 PM)Boba TC Wrote: I do not want to test my IMAP4 'skills' on real mail boxes; so created a test gmail one, enabled IMAP, but need more help: can not login to it.

Per https://support.google.com/accounts/answer/6010255:

Quote:To help keep your account secure, from May 30, 2022, ​​Google no longer supports the use of third-party apps or devices which ask you to sign in to your Google Account using only your username and password.

So, you have three choices:

- go into your Gmail account and turn "less secure apps" back on. Then you can login with your Gmail username and password as before.

- go into your Gmail account and turn on 2FA and create an app-specific password. Then you can login with your Gmail username and app password.

- implement OAuth2 in your code. See https://developers.google.com/identity/protocols/oauth, and have a look at https://github.com/geoffsmith82/GmailAuthSMTP/, which should be adaptable for IMAP, not just SMTP. Also see this branch https://github.com/indysockets/indy/tree/sasl-oauth in Indy's repo.

(06-26-2022, 12:19 AM)Boba TC Wrote: I think google requires SASL now. The IDE Tool Palette does have 'Indy SASL' components but no mentioning of OAuth2. Am I doomed with RAD Studio 2009?

https://github.com/geoffsmith82/GmailAuthSMTP/

https://github.com/indysockets/indy/tree/sasl-oauth

(06-26-2022, 04:15 AM)Boba TC Wrote: from my example above
...
what is the correct C++ syntax of TIdIMAP4::SendCmd method?

Try this:

Code:
s2 = IdIMAP4->SendCmd(IdIMAP4->NewCmdCounter, "FETCH 10:20 (FLAGS)", OPENARRAY(String, ("FETCH")));

Or, you can omit the counter and TIdIMAP4 will generate one for you:

Code:
s2 = IdIMAP4->SendCmd("FETCH 10:20 (FLAGS)", OPENARRAY(String, ("FETCH")));

Reply


Messages In This Thread
TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-24-2022, 09:10 PM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-25-2022, 06:46 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-25-2022, 07:13 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-25-2022, 10:58 PM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-27-2022, 01:18 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-26-2022, 12:19 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-26-2022, 04:15 AM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-29-2022, 02:36 AM
RE: TIdIMAP4::RetrieveHeader speed - by rlebeau - 06-29-2022, 03:26 PM
RE: TIdIMAP4::RetrieveHeader speed - by Boba TC - 06-30-2022, 02:14 AM

Forum Jump:


Users browsing this thread: 2 Guest(s)