POP3 Include (crossplatform)

Share your advanced PureBasic knowledge/code with the community.
BarryG
Addict
Addict
Posts: 4126
Joined: Thu Apr 18, 2019 8:17 am

Re: POP3 Include (crossplatform)

Post by BarryG »

Thanks for trying, Hexor, but it says "Unknown username" for me. Tried with both "name" and "name@gmail.com", and with using my Gmail app password (which works with other apps). Seems this problem will never be solved for me.

This is literally what I'm using -> https://temp-file-share.web.app/d/yZaBLtd749
infratec
Always Here
Always Here
Posts: 7580
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: POP3 Include (crossplatform)

Post by infratec »

I added a pop3s example in my libcurl package.
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: POP3 Include (crossplatform)

Post by HeX0R »

For me it works with name@gmail.com and the app password.
Using the main password will end-up with unknown username/password.

Make sure to have the libtls.dll, if it is not found, the example will not tell you about it, but it would end-up in "Unknown username!", because it is using non-TLS mode.
I might extend the example a little bit
Last edited by HeX0R on Sat Nov 18, 2023 11:01 am, edited 3 times in total.
BarryG
Addict
Addict
Posts: 4126
Joined: Thu Apr 18, 2019 8:17 am

Re: POP3 Include (crossplatform)

Post by BarryG »

Damn. Wonder why it doesn't like my details.
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: POP3 Include (crossplatform)

Post by HeX0R »

I've added a warning popup to the example, when TLS is not active.
BarryG
Addict
Addict
Posts: 4126
Joined: Thu Apr 18, 2019 8:17 am

Re: POP3 Include (crossplatform)

Post by BarryG »

I can't win. This is so frustrating. Can you put it all in a working zip file for me? I don't know what's wrong.

Code: Select all

---------------------------
Warning
---------------------------
No TLS active!
Please check your libtls-xx.dll path
---------------------------
OK   
---------------------------
My code:

Code: Select all

Global LIBTLSFILE$ = "libtls-15.dll" ; Same dir as main app, but even hard-coding it doesn't help.
XIncludeFile "pop3.pbi"

Global *pop3._POP3_   = CreatePop3Object()  ;<- our pop3 interface
Global Pop3_Semaphore = CreateSemaphore()   ;<- for our thread to inform us, that new Message arrived
Global Pop3_Mutex     = CreateMutex()       ;<- Mutex for the Linked List
Global NewList Tempfiles.s()                ;<- all of our temp files we created. Delete afterwards
Global NewList Messages.i()                 ;<- Messages from threads to main

If TLSG\DLL = 0
  MessageRequester("Warning", "No TLS active!" + #LF$ + "Please check your libtls-xx.dll path", #PB_MessageRequester_Warning)
EndIf
User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: POP3 Include (crossplatform)

Post by HeX0R »

User avatar
HeX0R
Addict
Addict
Posts: 1189
Joined: Mon Sep 20, 2004 7:12 am
Location: Hell

Re: POP3 Include (crossplatform)

Post by HeX0R »

I made some improvements.
Tested it successfully with my gmail and my gmx account.
BarryG
Addict
Addict
Posts: 4126
Joined: Thu Apr 18, 2019 8:17 am

Re: POP3 Include (crossplatform)

Post by BarryG »

Just woke up to a new day and your example in the zip file now works! Thanks! I've spent so long on this that I'm not going to compare old/new code to see why it was initially failing. Thank you again!
flashbob
User
User
Posts: 92
Joined: Sat May 11, 2024 4:04 pm

Re: POP3 Include (crossplatform)

Post by flashbob »

... is there a way to get libtls.a for mac without compiling ? Or is it not that easy?
Post Reply