PurePOP3 library : POP3 functions

All PureFORM, JaPBe, Libs and useful code maintained by gnozal

Moderator: gnozal

gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 for 4.40?

Post by gnozal »

UserOfPure wrote:Hi, yes, it works now with b=PurePOP3_GetMessageTextInMemory(#True) instead. But that's weird, because I've been sending the same types of mail over and over so far, and this is the first time I've had to use the #True flag with it.
Anyway, is there any harm in using b=PurePOP3_GetMessageTextInMemory(#True) all the time, even if the mail is NOT html? Or should I always check first with PurePOP3_IsMessageHTML() and then do an If/Then accordingly?
In an e-mail you may have two versions of the same text : plain text and HTML.
PurePOP3_GetMessageTextInMemory([#False]) is searching for 'text/plain', PurePOP3_GetMessageTextInMemory(#True) for 'text/html'.

If PurePOP3_GetMessageTextInMemory() fails, it may be because there is no text (only attachments ?), or because the text is only available as HTML.

Note : even if set to HTML mode, most e-mail clients also send a 'text/plain' version ; this explains that PurePOP3_GetMessageTextInMemory([#False]) rarely fails.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: PurePOP3 for 4.40?

Post by UserOfPure »

I would like to suggest that a future version do the checking for plain or html itself, and then deliver the correct format with the PurePOP3_GetMessageTextInMemory() command, without needing the #True or #False flag. Because now I'm using b=PurePOP3_GetMessageTextInMemory(PurePOP3_IsMessageHTML()) instead to ensure it always works.
rdority
User
User
Posts: 34
Joined: Mon Mar 30, 2009 10:46 pm
Location: Vancouver, BC

Re: PurePOP3 library : POP3 functions

Post by rdority »

I Agree. I am getting comiler/linker errors as well.

A linker error. It doesn't say much in the IDE except Linker error.

I get a message box which says: POLINK error and it says it has something to do with SYS_AllocateString but I don't find that anywhere in my code.

This was fine before version 4.40 for x86 but began failing then. I tried version 4.41 for x86 but it did not help.

I then re-installed version 4.30 for x36 and the issue cleared up. So maybe PurePop3 library is not savvy to versions after 4.30 on x36?

At any rate, I'd all but given up on PureBasic because my app needs a reliable Pop3 socket and PurePop3 was already not working properly for me and this never got resolved or explained.

Respectfully, I feel that PurePOP3 is a bit of an achille's heel of PureBasic's.

(Respectfully, there are some other things about PureBasic that never seem to get resolved but most have work arounds, albeit frustrating just

the same.)

I have to admit I am in the process of porting my vanguard product which was originally written in VB6 to Visual Basic 2008, not to PureBasic. :(
UserOfPure
Enthusiast
Enthusiast
Posts: 469
Joined: Sun Mar 16, 2008 9:18 am

Re: PurePOP3 library : POP3 functions

Post by UserOfPure »

rdority wrote:Respectfully, I feel that PurePOP3 is a bit of an achille's heel of PureBasic's.
You do know that PurePOP3 is NOT part of PureBasic, don't you? It's a third-party add-on, so any failings are not PureBasic's fault.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 library : POP3 functions

Post by gnozal »

Respectfully,
rdority wrote:I am getting comiler/linker errors as well.
1. Did you use the proper library version ?
PB3.94 : http://freenet-homepage.de/gnozal/PurePOP3.zip
PB4.0x : http://freenet-homepage.de/gnozal/PurePOP3_.zip
PB4.1x : http://freenet-homepage.de/gnozal/PurePOP3__.zip
PB4.2x : http://freenet-homepage.de/gnozal/PurePOP3___.zip
PB4.3x : http://freenet-homepage.de/gnozal/PurePOP3_430.zip
PB4.4x : http://freenet-homepage.de/gnozal/PurePOP3_440.zip

2. If you don't use jaPBe, did you enable the appropriate subsystem ?
I.e. UserLibThreadSafe if you use threadsafe mode.
rdority wrote:Respectfully, I feel that PurePOP3 is a bit of an achille's heel of PureBasic's.
As UserOfPure already wrote, PurePOP3 is not part of Purebasic.
If you don't like my tools, don't use them, or post a complete error report (PB version , LIB version, source that demonstrates the problem, etc...).
Don't blame Purebasic.

Thanks
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
singo
User
User
Posts: 35
Joined: Mon Apr 23, 2007 4:50 am
Location: Nabiac NSW Australia

PurePOP3 Saving text attachments ?

Post by singo »

Hi,

I am having trouble with saved text attachments using PurePOP3.

What is happening is that lines longer than about 70 characters long get an = and new line character added to that point in the saved file.

Image files as attachments don't have the same problem.

I have reproduced this on multiple machines with multiple versions of PureBasic 4.31 & 4.41 and associated versions of PurePOP3. I have also tried using PurePOP3_SaveAttachementsToFile and PurePOP3_SaveAttachementToFile with no change.
I also tried multiple mail servers with no change either.

If the exact same email is received by email clients, this does not occur.

Here is a small example of a file being sent

Code: Select all

Userid,User,ProductID,ProductDesc,Reference,Date,Matter,Cost,Cost_ex_GST,Gst
lneasc01,"Homesense Searching (Charlestown)",HWSLP,"Hunter Water Service Location Plan","4/DP8293",15:20 12 Mar 2010,"N15004",$22.33,$20.30,$2.03
And what it is saved as an attachment

Code: Select all

Userid,User,ProductID,ProductDesc,Reference,Date,Matter,Cost,Cost_ex_GST,=
Gst
lneasc01,"Homesense Searching (Charlestown)",HWSLP,"Hunter Water Service =
Location Plan","4/DP8293",15:20 12 Mar 2010,"N15004",$22.33,$20.30,$2.03
Any ideas on why this might be happening ?

Thanks
Singo
Australia
Singo
Win10, Win7, Debian x86 & OSX ~ PB 5.70 LTS
Minimbah NSW Australia
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 Saving text attachments ?

Post by gnozal »

singo wrote:I am having trouble with saved text attachments using PurePOP3.
What is happening is that lines longer than about 70 characters long get an = and new line character added to that point in the saved file.
When some e-Mail clients * send plain text (not base64 encoded), some characters are transcribed to '=XX', where XX is the ANSI code of the character (* or maybe it's the POP3 server, I don't know). This is true for any text, message text or attachments.

Currently, PurePOP3 translates this 'encoded' text back to 'normal' text only for the message text, not for the attachments.

Possible solution(s) :
1. Send base64 encoded text attachments
2. Send zipped text attachments
3. Translate all the '=XX' characters in the plain text attachments
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
HwyStar
Enthusiast
Enthusiast
Posts: 101
Joined: Mon Apr 05, 2010 7:13 pm
Location: Reno, Nevada

Re: PurePOP3 library : POP3 functions

Post by HwyStar »

Great Library gnozal and Thanks for the hard work you have put into it over the years!

Are there any limitations on the size of attachment files that can be received using your library?

I had a client that sent me a 9 meg file and the PurePOP3 library error-ed out. I tried increasing the POP3 timeout value without success. Outlook Express was able to downloaded the file.

I am in the process of coding my own routines so the code has not been cleaned up to show anyone yet! I know you like seeing code to explore what the problem may be, but it is not worth wasting your time looking at spaghetti code. :shock:

Thanks again Man!
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 library : POP3 functions

Post by gnozal »

HwyStar wrote:Are there any limitations on the size of attachment files that can be received using your library?
It should only be limited by the available memory (I will have to take a closer look).
What error code is returned ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
HwyStar
Enthusiast
Enthusiast
Posts: 101
Joined: Mon Apr 05, 2010 7:13 pm
Location: Reno, Nevada

Re: PurePOP3 library : POP3 functions

Post by HwyStar »

Are there any limitations on the size of attachment files that can be received using your library?
Since I made that post I have not tried that email again... I am thinking that my threaded procedure ran again since the file was taking so long to download, hence it blew up the first process. My email client is still in development but I will try that email again before I release it into production. I have tweaked the procedure so that it is only running once. Thanks for the reply gnozal!
kvitaliy
Enthusiast
Enthusiast
Posts: 162
Joined: Mon May 10, 2010 4:02 pm

Re: PurePOP3 library : POP3 functions

Post by kvitaliy »

Hi Gnozal,
just testing this library of yours for the first time.
It's pretty easy to use!

One thing though:
While using "PurePOP3_GetMessageTextInMemory" I always receive: " This is a multi-part message in MIME format."
How to see the contents?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 library : POP3 functions

Post by gnozal »

kvitaliy wrote:Hi Gnozal,
just testing this library of yours for the first time.
It's pretty easy to use!
One thing though:
While using "PurePOP3_GetMessageTextInMemory" I always receive: " This is a multi-part message in MIME format."
How to see the contents?
That might be a bug (this library is still (and will probably ever be) in beta status) ... Maybe you could use the PurePOP3_Trace() feature and send me the result ?
Or there is not plain text, only HTML encoded text ? Did you try PurePOP3_GetMessageTextInMemory(#True) ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
rdority
User
User
Posts: 34
Joined: Mon Mar 30, 2009 10:46 pm
Location: Vancouver, BC

Re: PurePOP3 library : POP3 functions

Post by rdority »

Hi Folks,

Does anyone know if these PurePop3 and PureSMTP libs work with PureBasic x64?

I just upgraded from Win XP to Win 7 and I'm now getting assembler error MP116, saying operands are not the same size.

My PureBasic compiler is working for the sample code that comes with PB though. ;)

Thanks in advance,
Roark
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: PurePOP3 library : POP3 functions

Post by gnozal »

rdority wrote:Does anyone know if these PurePop3 and PureSMTP libs work with PureBasic x64?
They don't.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
rdority
User
User
Posts: 34
Joined: Mon Mar 30, 2009 10:46 pm
Location: Vancouver, BC

Re: PurePOP3 library : POP3 functions

Post by rdority »

Well unfortunately my entire experience so far with PB has rested on the shoulders of PurePop3. My little app which I spent months on worked fairly well in Xp but now I can't even use it in Windows 7.

Since MS doesn't support Xp anymore, this presents a real problem and a huge disappointment in PureBasic.
Post Reply