Authentication Failed - SMTP Email
-
Wednesday, December 21, 2005 2:48 PM
Hello,
We are in the process of converting a VB6 project to .NET using VS2005. The problem is with sending the email. The error I am getting is the following:
System.Net.Mail.SmtpException: Syntax error, command unrecognized. The server response was: 5.7.0 Authentication failed
at DCTEmail.Email.SendMail()
at CustAdmin.frmEmail.btnSend_Click(Object sender, EventArgs e) in E:\SaberTooth.V4\SaberTooth\SaberTooth\Forms\System\frmEmail.vb:line 67My code snippet looks as follows:
Try
Dim Message As New MailMessage(SentFrom, SendTo, Subject, Body)
Message.IsBodyHtml = False
Dim MailClient As New SmtpClient
MailClient.Host = strSMTPServerIP
MailClient.Port = 25
MailClient.UseDefaultCredentials = False
MailClient.Credentials = New NetworkCredential(strSMTPUID, strSMTPPWD)
MailClient.DeliveryMethod = SmtpDeliveryMethod.Network
MailClient.Send(Message)
MailClient = Nothing
SendOK = True
Catch ex As Exception
SendOK = False
Throw ex
End TryI am trying to send emails both internally and externally with the same results. We use Kerio Mail Server running on a Linux Box. I'm at my wits end. Apart from the obvious differences between VB6 and .NET, I can't explain why this is happening. I use IPWorks on the VB6 application. Can this be an issue with .NET?
Thanks for taking the time to help me.
Answers
-
Thursday, December 22, 2005 10:02 PM
I tried another server (SWBell) and the process worked fine. The problem does appear to be with Kerio. I contacted their support team. Here is the response they provided:
"The LOGIN SASL mechanism is obsoleted in favor of the PLAIN SASL mechanism. Clients SHOULD implement the PLAIN SASL mechanism and use it whenever offered by a server. The LOGIN SASL mechanism SHOULD NOT be used by a client when other plaintext mechanisms are offered by a server.
According to IETF draft (expired, obsolete), the server must send non-empty challenge first. Therefore, LOGIN authentication cannot use "initial-response" parameter.
Conclusion:
KMS DOES comply to RFC 2554. The client has a bug in SASL LOGIN mechanism implementation. Moreover, the client should use PLAIN instead of LOGIN."
I hope that helps explain why the script is having issues authenticating.
Anyone have any ideas on how to change to PLAIN instead of LOGIN?
Thanks
-- Val
All Replies
-
Thursday, December 22, 2005 10:02 PM
I tried another server (SWBell) and the process worked fine. The problem does appear to be with Kerio. I contacted their support team. Here is the response they provided:
"The LOGIN SASL mechanism is obsoleted in favor of the PLAIN SASL mechanism. Clients SHOULD implement the PLAIN SASL mechanism and use it whenever offered by a server. The LOGIN SASL mechanism SHOULD NOT be used by a client when other plaintext mechanisms are offered by a server.
According to IETF draft (expired, obsolete), the server must send non-empty challenge first. Therefore, LOGIN authentication cannot use "initial-response" parameter.
Conclusion:
KMS DOES comply to RFC 2554. The client has a bug in SASL LOGIN mechanism implementation. Moreover, the client should use PLAIN instead of LOGIN."
I hope that helps explain why the script is having issues authenticating.
Anyone have any ideas on how to change to PLAIN instead of LOGIN?
Thanks
-- Val
-
Friday, December 23, 2005 4:18 AM
Can you enable tracing using the steps discussed in
http://blogs.msdn.com/dgorti/archive/2005/09/18/471003.aspx
and send to malarch@dontspam.microsoft.com.
Also a netmon trace as outlined in http://blogs.msdn.com/dgorti/archive/2005/10/29/486887.aspx
will be helpful .
Thanks
Malar
-
Wednesday, December 28, 2005 10:17 AM
Malar,
Email has been sent to malarch@dontspam.microsoft.com along with trace file. Looking forward to your response.
-- Val
-
Monday, February 27, 2006 7:53 AM
I got the same problem.
So what's the cure?
Thanks,
ffee
-
Monday, February 27, 2006 3:38 PM
I have not been able to resolve the problem. I sent an email to Malar however have not heard anything. I suspect that it's a microsoft bug since I have the same program running using VB6 with and it works fine with the same server, user id and password.
I'll keep you posted if I find anything out.
-
Monday, February 27, 2006 3:39 PM
Malar,
I never did hear back from you after my email. Any ideas? Would you like me to resend what I sent you originally?
Thanks
-
Monday, February 27, 2006 7:06 PM
Please send it again. My machine crashed and I lost the emails..
-
Wednesday, March 15, 2006 11:23 AM
Malar,
Just resent the file. to you via email.
-
Sunday, March 11, 2007 7:25 PMI am getting the same error.
Please how should I get this working? -
Tuesday, June 19, 2007 3:01 PMI also faced this. Will there be any comment from Microsoft?

