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 »

DoubleDutch wrote:Sorry - nothing to do with threadsafe, just a coincidence.

It's to do with authentication.

I tested your example programs:

PureSMTP_Test.pb -> works fine

PureSMTP_TEST_AUTH.pb -> crashes at PureSMTP_SendMail
Authentication uses base64 encoding ; maybe this is the problem with vista.
Could you please download the test programs again and use authentication (to enable authentication just fill the UseName/Password stringgadgets).
Last edited by gnozal on Mon Feb 12, 2007 12:13 pm, edited 2 times in total.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

This works:

Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, "", Password)

This crashes:

Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I did fill in the password string, works fine...
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Just tested the Base64 commands in PureBasic - no crash.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

This also crashes:

Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName,"")

When it crashes, it gets this far:

220 spunkymail-a11.g.dreamhost.com ESMTP

Hope this helps...
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

Could you please download the test programs again and use authentication (to enable authentication just fill the UseName/Password stringgadgets).
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Tested with your new test program.

Message sent!
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

I tested again - this time putting the wrong password in by accident.

It crashed:

Error c00000005
An attempted read or write to/from an address to which theat process isn't allowed
Module: c:\purebasic400\Program\PureSMTP_VISTA_TEST.pb; Line: 416
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Trying it again, with correct info had the same error.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:Tested with your new test program.

Message sent!
That's weird ...
Maybe some strange Tailbite problem like the one with Win98 ( http://www.purebasic.fr/english/viewtop ... &start=141 )

I have uploaded http://freenet-homepage.de/gnozal/PureSMTP_BETA.zip (standard ANSI debug lib), to be placed in the userlibraries folder.
It will create a PureSMTP_TRACE.txt log file, maybe it will help to locate the problem.

Edit (was posting while you posted)
Line 416 : FreeMemory(*B64EncodeBufferB)

Code: Select all

Procedure.s Base64Encode(strText.s)
  Protected Result.s, *B64EncodeBufferA, *B64EncodeBufferB, OutputBufferLength.l, InputBufferLength.l
  InputBufferLength = Len(strText)
  OutputBufferLength = InputBufferLength * 2
  If OutputBufferLength < 64
    OutputBufferLength = 64
  EndIf 
  *B64EncodeBufferA = AllocateMemory(InputBufferLength)
  If *B64EncodeBufferA
    *B64EncodeBufferB = AllocateMemory(OutputBufferLength)
    If *B64EncodeBufferB
      PokeS(*B64EncodeBufferA, strText) ;     PokeS(*B64EncodeBufferA, strText, InputBufferLength, #PB_Ascii) if unicode
      Base64Encoder(*B64EncodeBufferA, InputBufferLength, *B64EncodeBufferB, OutputBufferLength)
      Result = PeekS(*B64EncodeBufferB)
      FreeMemory(*B64EncodeBufferB)
    EndIf
    FreeMemory(*B64EncodeBufferA)
  EndIf
  ProcedureReturn Result
EndProcedure

Debug Base64Encode("hello world")
Could you test this code in vista ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

Result of your test source:

aGVsbG8gd29ybGQ=


Result of the test library:

Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)

I get a compilation error:
line 16: PureSMTP_SendMail(): Incorrect number of parameters.
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:Result of your test source:
aGVsbG8gd29ybGQ=
So no crash ...

DoubleDutch wrote:Result of the test library:
Status.l = PureSMTP_SendMail(MailTo, MailFrom, Subject, MsgBody, Attachments, UserName, Password)
I get a compilation error:
line 16: PureSMTP_SendMail(): Incorrect number of parameters.
Oops, sorry, wrong lib version, should be fixed.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

The only crash I could get with your Base64 routine is if the input is an empty string.

The new lib compiles and generates a PureSMTP_Trace file, but the file has zero length.

Maybe if you have a dialog between each step (incrementing a number). I can tell you which number it stops on?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

DoubleDutch wrote:The new lib compiles and generates a PureSMTP_Trace file, but the file has zero length.
Works here ... !
DoubleDutch wrote:Maybe if you have a dialog between each step (incrementing a number). I can tell you which number it stops on?
Ok, I have uploaded a version with MessageRequester.
I need the message more than the number to locate the problem.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Post by DoubleDutch »

The last message that is okay is #10

SEND: YW50aG9 ... NvbQ==

(the ... is me, it didn't display this).

After #10 it crashed.

In case you need to know, message 9, it was:

RECEIVE: 334 VXNI .... WU6
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply