Trapping SMTP e-mail error

Postby Antonio Linares » Tue Oct 07, 2008 8:52 pm

Rick,

Please change bFailure this way:
Code: Select all  Expand view
oOutMail:bFailure := { | oSocket, nError, cReply | LogFile( "log.txt", { nError, "--", cReply, ProcName( 2 ) } ), oOutMail:nStatus := 7 }

Please change the 2 value in the ProcName() call so you get the proper method name, so we locate where Method Failure() has been called from, thanks
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Tue Oct 07, 2008 9:16 pm

Antonio

Here are your results ..

Rick

Code: Select all  Expand view
10/07/2008 17:14:46: 0   --   550   TSMTP:ONREAD   
10/07/2008 17:14:56: 10048   --      TSMTP:ONCONNECT
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Antonio Linares » Tue Oct 07, 2008 9:30 pm

Rick,

It seems there is an error caused for a second try to connect to the same address:

http://support.ipswitch.com/kb/WSK-19980701-EM03.htm
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Tue Oct 07, 2008 11:08 pm

Antonio

I have a instinctive feeling the port was not getting close on ( the first ) failure .. .. that is my guess ..

I am not a guru on the code .. is there a way you can look and see if the origional error actually closes the port ??

Thanks
Rick
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby James Bott » Wed Oct 08, 2008 12:50 am

Rick,

Logfile() is a FW function and may also be called from TSocket which is called by TSMTP. It is called if oSocket:lDebug == .t. I don't know if it is set to .T. when it is being used by TSMTP.

Or, maybe you are using Logfile() somewhere else in your program?

For a quick test, you could try changing the filename passed to LogFile() to a different name other than "logfile.txt" and see if you still get the same two errors logged.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Rick Lipkin » Wed Oct 08, 2008 1:10 am

James

I think what is happening is that when the e-mail fails .. the SMTP port is not being closed properly .. so when I come back and re-run the same code and send another e-mail .. we get the open port error .. I think this is a 'bug' somewhere in Tsmtp .. I just don't know where to look :(

Rick
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby James Bott » Wed Oct 08, 2008 1:17 am

Rick,

Just add an oMail:oSocket:end() after sending the mail to test if this is the problem.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Wed Oct 08, 2008 1:20 am

Rick,

>.. is there a way you can look and see if the origional error actually closes the port ??

Yes, it does. See TSMTP method Failure().

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby James Bott » Wed Oct 08, 2008 1:23 am

Rick,

For more testing try turning on the logfile() in oSocket.

define mail oMail...

oMail:oSocket:cLogfile:="socket.log"
oMail:oSocket:lDebug:=.t.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Postby Antonio Linares » Sun Oct 12, 2008 5:51 pm

Rick,

Do you properly send emails with authentification ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Sun Oct 12, 2008 6:37 pm

Antonio

I see where you published the Tsmtp ( failure ) modification in ver 810 .. thank you .. did you also include the mods for the attachments ??

As far as your question on 'authindication' .. I am a bit confused on the context of your question :? ( ok .. just read the other smtp post .. getting up to speed here )

Our Agency Enterprise e-mail system is Novell GroupWise ( mapi .. don't confuse that with smtp ) and our address book is published ( as I understand it ) thru both GroupWise and available thru our ( additional smtp ) LDAP... I hope I am correct in my explaination here.

Just a side note here .. the reason I do not use mapi .. I just don't feel comfortable GroupWise will be our e-mail standard as we are moviing closer to MS Exchange. I chose SMTP as my choice because SMTP will still be around long after GroupWise or Exchange...

Our SMTP is only intranet or internal to our Agency ( some 7k users ) .. the problem I am running into with Tsmtp is when ( within my application ) a user mis-spells a userid within our 'domain' and when I fire off an e-mail .. if the address lookup fails in SMTP .. it just fails and I need a way to trap that in order to recover and to write the failure to a log to be able to review and fix.

Tsmtp just seems to return the error from SMTP ( which is ok ) and we need to find out if Failure() does indeed close the port or if the program trace for the second failure is actually routed thru Failure () .. hense the different failure codes ..

I can not ( to my knowledge ) pre-test or 'authendicate' a valid e-mail address ( unless you have a way I can pre-test the existance of a valid address ?? ) ..

I need to download the latest 8.10 and look at it .. what do I need to change to send with authendication ??

Rick
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Antonio Linares » Sun Oct 12, 2008 7:18 pm

Rick,

>
I see where you published the Tsmtp ( failure ) modification in ver 810 .. thank you .. did you also include the mods for the attachments ??
>

We included the most recent Class TSmtp that we got, but we may be missing the attachments mods.

Regarding "authentification", I asked you as it was asked in http://forums.fivetechsoft.com/viewtopic.php?t=13068 and I wonder if you could help each other.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41414
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Rick Lipkin » Sun Oct 12, 2008 7:32 pm

Antonio

I just e-mailed you the attachment mod fix that Tim Stone so graciously sent me.

I will look at the authendication thread and see if we can share our experiences.

Thanks
Rick
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Postby Rick Lipkin » Sun Oct 12, 2008 8:10 pm

To All watching the two Tsmtp threads .. here is the cross post I just made:

http://www.fivetechsoft.com/forums/view ... 6762#66762

Rick
User avatar
Rick Lipkin
 
Posts: 2636
Joined: Fri Oct 07, 2005 1:50 pm
Location: Columbia, South Carolina USA

Previous

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 49 guests