It is currently Sat Apr 21, 2018 11:36 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 337 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22, 23  Next
Author Message
 Post subject: Re: PurePOP3_IsMessageHTML() hangs
PostPosted: Sat Jan 29, 2011 11:07 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
gnozal wrote:
Without the traces, I can do zip.

See your PM. ;) Thanks.


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Jan 29, 2011 11:24 am 
Offline
PureBasic Expert
PureBasic Expert

Joined: Fri Apr 25, 2003 5:24 pm
Posts: 7581
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.

_________________
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Jan 29, 2011 11:44 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Jan 29, 2011 12:34 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Dec 18, 2010 4:40 am
Posts: 151
gnozal wrote:
I have updated the library (PB 4.50 version).

Thank you gnozal, I can confirm it works correctly now. :)


Top
 Profile  
Reply with quote  
 Post subject: PurePOP3_OpenPOP3Connection() with invalid params
PostPosted: Thu Mar 10, 2011 1:51 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
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.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3_OpenPOP3Connection() with invalid params
PostPosted: Thu Mar 10, 2011 2:39 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3_OpenPOP3Connection() with invalid params
PostPosted: Mon Mar 14, 2011 11:51 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
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!

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Wed Mar 16, 2011 8:53 pm 
Offline
User
User
User avatar

Joined: Tue Jun 21, 2005 7:26 pm
Posts: 85
Location: Malta
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!


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Thu Mar 17, 2011 9:42 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Thu Mar 17, 2011 7:43 pm 
Offline
User
User
User avatar

Joined: Tue Jun 21, 2005 7:26 pm
Posts: 85
Location: Malta
Thanks again gnozal. Works like a charm


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Mar 26, 2011 9:30 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
Found an issue with the way PurePOP3 parses a HTML email. Here's a snippet of the email's raw source:

Code:
--=_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.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Mar 26, 2011 10:27 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
MachineCode wrote:
Found an issue with the way PurePOP3 parses a HTML email.
Code:
<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:
<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.

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Mar 26, 2011 11:55 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
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:
--=_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.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Mar 26, 2011 12:03 pm 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4229
Location: Strasbourg / France
Now that's odd : the dumps are the exact copy of the data received with ReceiveNetworkData().
Code:
...
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...

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
Reply with quote  
 Post subject: Re: PurePOP3 library : POP3 functions
PostPosted: Sat Mar 26, 2011 12:12 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1482
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...?

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Last edited by MachineCode on Sat Mar 26, 2011 12:29 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 337 posts ]  Go to page Previous  1 ... 18, 19, 20, 21, 22, 23  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye