Page 21 of 23

Re: PurePOP3_IsMessageHTML() hangs

Posted: Sat Jan 29, 2011 11:07 am
by C64
gnozal wrote:Without the traces, I can do zip.
See your PM. ;) Thanks.

Re: PurePOP3 library : POP3 functions

Posted: Sat Jan 29, 2011 11:24 am
by PB
Interesting. My app was also having issues and it uses this command, so I will be watching this fix with interest, in case it's the problem I've been having.

Re: PurePOP3 library : POP3 functions

Posted: Sat Jan 29, 2011 11:44 am
by gnozal
I have updated the library (PB 4.50 version).

The problem was that the boundary definition in your mail was missing quotes. I have updated the library internal functions to handle this case. Hopefully, it will not break anything else.

Re: PurePOP3 library : POP3 functions

Posted: Sat Jan 29, 2011 12:34 pm
by C64
gnozal wrote:I have updated the library (PB 4.50 version).
Thank you gnozal, I can confirm it works correctly now. :)

PurePOP3_OpenPOP3Connection() with invalid params

Posted: Thu Mar 10, 2011 1:51 pm
by MachineCode
I just noticed today that if I call PurePOP3_OpenPOP3Connection() with an invalid username or invalid password, then my app freezes at that command and uses 50% CPU while the command tries to authenticate during its timeout period. So, is it possible this command can be modified to not use such high CPU during authentication? Because my PC slowed down noticeably today and I didn't realise why at first, and then discovered it was due to my app trying to authenticate with an invalid username.

Re: PurePOP3_OpenPOP3Connection() with invalid params

Posted: Thu Mar 10, 2011 2:39 pm
by gnozal
MachineCode wrote:I just noticed today that if I call PurePOP3_OpenPOP3Connection() with an invalid username or invalid password, then my app freezes at that command and uses 50% CPU while the command tries to authenticate during its timeout period. So, is it possible this command can be modified to not use such high CPU during authentication? Because my PC slowed down noticeably today and I didn't realise why at first, and then discovered it was due to my app trying to authenticate with an invalid username.
- PurePOP3 uses Delay() in the loop waiting for the POP server answer.
- you could try to change the time out using PurePOP3_SetTimeOut()

Anyway, I have updated the PurePOP3 library with a slightly greater delay. Maybe it helps.

Re: PurePOP3_OpenPOP3Connection() with invalid params

Posted: Mon Mar 14, 2011 11:51 pm
by MachineCode
gnozal wrote:I have updated the PurePOP3 library with a slightly greater delay. Maybe it helps.
Yep, my app now shows 0% CPU in the Task Manager when trying to connect with an invalid login, instead of 50%. Thank you!

Re: PurePOP3 library : POP3 functions

Posted: Wed Mar 16, 2011 8:53 pm
by SunSatION
Hi gnozal.

I'm wondering whether it is possible or not to implement the TOP function provided by POP? The reason behind this is that I would like to get just the header part ( subject, address, .... ) without actually downloading the whole message before.

Thanks!

Re: PurePOP3 library : POP3 functions

Posted: Thu Mar 17, 2011 9:42 am
by gnozal
Update (PB4.5x version)

Changes :
- New function PurePOP3_RetrieveInfo(MessageNumber.l) [see help file]
  Retrieve message headers from POP3 server.
  . This function only retrieves the headers (not the message, nor the attachments) : use only PurePOP3_GetMessageInfo() after it.
  . Not all mail servers support the POP3 TOP command but if they do it is useful for only retrieving part of the message.

Re: PurePOP3 library : POP3 functions

Posted: Thu Mar 17, 2011 7:43 pm
by SunSatION
Thanks again gnozal. Works like a charm

Re: PurePOP3 library : POP3 functions

Posted: Sat Mar 26, 2011 9:30 am
by MachineCode
Found an issue with the way PurePOP3 parses a HTML email. Here's a snippet of the email's raw source:

Code: Select all

--=_alternative 0007629ECA25785F_=
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="ISO-8859-1"

<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><P style=3D"MARGIN: 0px">Thank you!!!</P><P style=3D"MARGIN: 0px">webu=
rl <A href=3D"http://www.bluesnews.com" target=3Dblank>http://www.bluesnews=
.com</A>--</P><P style=3D"MARGIN: 0px">&nbsp;</P></FONT><font face=3D"sans-=
serif"><p style=3D"font-weight:bold; font-family:sans-serif; font-size:12px=
The PurePOP3_IsMessageHTML() command returns 1 for the above. But then when I use PurePOP3_GetMessageTextInMemory(1) with it, the URL of "www.bluesnews.com" is returned in the body as "www.bluesnews..com" by mistake. Note the double-periods. I assume this is because in the raw source above, there is a "=" before the ".com" in the email, and the URL is also broken over two lines at that exact part of text. Hope this can be fixed easily.

Re: PurePOP3 library : POP3 functions

Posted: Sat Mar 26, 2011 10:27 am
by gnozal
MachineCode wrote:Found an issue with the way PurePOP3 parses a HTML email.

Code: Select all

<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><P style=3D"MARGIN: 0px">Thank you!!!</P><P style=3D"MARGIN: 0px">webu=
rl <A href=3D"http://www.bluesnews.com" target=3Dblank>http://www.bluesnews=
.com</A>--</P><P style=3D"MARGIN: 0px">&nbsp;</P></FONT><font face=3D"sans-=
serif"><p style=3D"font-weight:bold; font-family:sans-serif; font-size:12px=
I use a decode routine which should handle the '=' stuff.
Basically, it does this :
  =CRLF => nothing
  ..CRLF => .CRLF
  =XX => CHR(DEC(XX)) < if XX is a valid HEX number >
Using your snippet above and assuming that there is a CRLF after each line, my decode routine outputs this :

Code: Select all

<FONT face="Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=2><P style="MARGIN: 0px">Thank you!!!</P><P style="MARGIN: 0px">weburl <A href="http://www.bluesnews.com" target=blank>http://www.bluesnews.com</A>--</P><P style="MARGIN: 0px">&nbsp;</P></FONT><font face="sans-serif"><p style="font-weight:bold; font-family:sans-serif; font-size:12px=
Which looks fine to me.
I can't test more without the complete traces.

Re: PurePOP3 library : POP3 functions

Posted: Sat Mar 26, 2011 11:55 am
by MachineCode
I did some checking. The source I posted above is what my ISP shows as the raw message source. But when I used PurePOP3_Trace(1), the debug files actually show it like this:

Code: Select all

--=_alternative 0007629ECA25785F_=
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="ISO-8859-1"

<FONT face=3D"Default Sans Serif,Verdana,Arial,Helvetica,sans-serif" size=
=3D2><P style=3D"MARGIN: 0px">Thank you!!!</P><P style=3D"MARGIN: 0px">webu=
rl <A href=3D"http://www.bluesnews.com" target=3Dblank>http://www.bluesnews=
..com</A>--</P><P style=3D"MARGIN: 0px">&nbsp;</P></FONT><font face=3D"sans-=
serif"><p style=3D"font-weight:bold; font-family:sans-serif; font-size:12px=
So, it seems your library is adding a second dot for some reason? Is there any point me sending you the traces if they don't match the raw source in the first place? If so, I will do it. Let me know.

Re: PurePOP3 library : POP3 functions

Posted: Sat Mar 26, 2011 12:03 pm
by gnozal
Now that's odd : the dumps are the exact copy of the data received with ReceiveNetworkData().

Code: Select all

...
BytesRead = ReceiveNetworkData(PurePOP3_ConnectionID, PurePOP3_Buffer, #PurePOP3_Buffer_Len)
...
; //////// DEBUG ////////
LIB_Debug("- RECEIVED (Buffer) : " + Str(BytesRead) + " BYTES")
LIB_Debug("<dump>")
LIB_Debug(PeekS(PurePOP3_Buffer, BytesRead))
LIB_Debug("</dump>")
; //////// DEBUG ////////
...
PurePOP3-DEBUG-COM.txt shows all the communication, PurePOP3-DEBUG-RETR-XX.txt only the final complete message.

Do you also find the duplicated dot in PurePOP3-DEBUG-COM.txt ? If yes, that's what ReceiveNetworkData() gets...

Re: PurePOP3 library : POP3 functions

Posted: Sat Mar 26, 2011 12:12 pm
by MachineCode
Yes, both "PurePOP3-DEBUG-COM.txt" and "PurePOP3-DEBUG-RETR-000.txt" have the double dot, but the message source in my ISP's webmail has only one. It's like the message source you get in Gmail when you click "Show original" when viewing an email. As a side-note, the "text/plain" part of these emails are correct, with only one dot ("weburl http://www.bluesnews.com--").

Maybe my ISP is fixing the double-dot when showing me the source? This might be a false alarm...?