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:

Post by gnozal »

netmaestro wrote:I've played with it some and I must say it is two thumbs up. Very easy to use and gets the job done nicely.
Thanks.
netmaestro wrote:One thing I noticed though, is that PurePOP3_GetMessageInfo() reports one attachment for a message that does not have any files attached. I'm guessing the message itself is counted as an attachment? Do we have to subtract 1 from that number to get the number of attached files? btw, thanks for the nice lib!
To find attachements, the lib is searching for boundaries. The problem is, when a message has different content types like 'plain text' and 'html text', it also has boundaries. I have to do some researches to find all possible content types to distinguish between text coding alternatives and real attachements.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
fsw
Addict
Addict
Posts: 1572
Joined: Tue Apr 29, 2003 9:18 pm
Location: North by Northwest

Post by fsw »

@Gnozal,
maybe I didn't make myself clear enough.

The text is 3 chars short.
So if the text is:
"Hello 1"
I get:
"Hell"

If PurePOP3_GetMessageSize() returns the value obtained with the POP3 'LIST' command, would this mean that the mail server reports less than it actually is?
What can be done about it?
The PurePOP3-DEBUG-RETR.txt file has all the text that was sent...

Another question: How to open a POP3 connection if there is a proxy?

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

Post by gnozal »

fsw wrote:If PurePOP3_GetMessageSize() returns the value obtained with the POP3 'LIST' command, would this mean that the mail server reports less than it actually is?
What can be done about it?
Strange, I never had this problem.
And yes, PurePOP3_GetMessageSize() returns the value obtained with the POP3 'LIST' command, nothing more, nothing less.

Code: Select all

      SendAMessage("LIST " + Str(MessageNumber) + #CrLf)
      Response = WaitForCompleteMessage()
      ; '+OK MessageNb Size' -> +OK 48 1832
      If Left(Response, 3) = #PurePOP3_Response_OK
        RValue = Val(StringField(Response, 3, " "))
      Else
        RValue = #PurePOP3_BadResponse
      EndIf
Does the PurePOP3_GetMessageTextInMemory() function work ?
fsw wrote:The PurePOP3-DEBUG-RETR.txt file has all the text that was sent...
Perhaps because PurePOP3_RetrieveMessage() allocates 1000 more bytes than PurePOP3_GetMessageSize() returns.
fsw wrote:Another question: How to open a POP3 connection if there is a proxy?
I don't know ... I never got anything to work. All the forum examples don't work or only if the proxy supports the 'connect' method wich is disabled for obvious security reasons by many system administrators.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Update [both libs : PB3.94 and PB4.00]

A lot of code updated

Changes :
- some bugs fixed
- better attachment handling
- better multipart/mixed/alternative... message handling
- retrieve plain or html text, quoted-printable
or base64 encoded

Still beta status ; use trace mode to help debugging.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Gnozal,

with the library pure_pop3 for PB4 is not possible to save a coded 8bit/base64 attachment.
if you use the function

PurePOP3_ListAttachementsForMessage()

the function return "no attachment".

tested with the code example PurePop3_Test1.pb.


any idea?

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

Post by gnozal »

jpd wrote:Hi Gnozal,

with the library pure_pop3 for PB4 is not possible to save a coded 8bit/base64 attachment.
if you use the function

PurePOP3_ListAttachementsForMessage()

the function return "no attachment".

any idea?

Best
jpd
Without an example, no : I need to see the raw e-mail message. Could you post (or PM me) a dump of the file ?
Use PurePOP3_Trace(#True) before your code and send me the PurePOP3-DEBUG*.txt files.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

debug File

Post by jpd »

Hi Gnozal,

The debug-file was send on your email account.

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

Re: debug File

Post by gnozal »

jpd wrote:Hi Gnozal,

The debug-file was send on your email account.

jpd
Thanks.
I found the problem : PurePOP3 doesn't find the message boundary.
It should be like : boundary="ThisIsTheBoundary"
In your message, it is boundary=ThisIsTheBoundary (the quotes are missing) ; I don't know if this is complient with the POP3 specifications.

Anyway, I will change the code to handle this.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Gnozal,

I have to thanks for the fast reply and analyse of this problem!


Best

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

Post by gnozal »

Update (both libs)

- fixed the boundary problem (I hope)
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
jpd
Enthusiast
Enthusiast
Posts: 167
Joined: Fri May 21, 2004 3:31 pm

Post by jpd »

Hi Gnozal,

super! the new library solve the problem with base64 coded mail.

Thanks very much!

jpd
klaver
Enthusiast
Enthusiast
Posts: 146
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Post by klaver »

Hi, your lib is just great.

Will there be a possibility to view the status of downloading messages (and attachments) ?
Something like PurePOP3_GetBytesDownloaded().

It would be nice to see something like that in a ProgressBar.
Especially with emails and/or attachments bigger than <for example> 10MB.
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

klaver wrote:Hi, your lib is just great.

Will there be a possibility to view the status of downloading messages (and attachments) ?
Something like PurePOP3_GetBytesDownloaded().

It would be nice to see something like that in a ProgressBar.
Especially with emails and/or attachments bigger than <for example> 10MB.
I will think about it for the next version.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
klaver
Enthusiast
Enthusiast
Posts: 146
Joined: Wed Jun 28, 2006 6:55 pm
Location: Schröttersburg

Post by klaver »

When will be next version?
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

klaver wrote:When will be next version?
When I have some time ... When it's done ...
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply