{"id":4932,"date":"2015-05-18T20:28:17","date_gmt":"2015-05-18T18:28:17","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=4932"},"modified":"2015-05-18T20:28:17","modified_gmt":"2015-05-18T18:28:17","slug":"livemail-co-uk-smtp-bug","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/livemail-co-uk-smtp-bug","title":{"rendered":"livemail.co.uk SMTP bug"},"content":{"rendered":"<p>Recently one of our clients reported an issue with the SMTP server they use. The problem occurred only in Mail.dll. Outlook was working correctly.<\/p>\n<blockquote><p>\nThe exception we are getting is:<\/p>\n<p>Limilabs.Client.ServerException: 5.5.1 Invalid command<br \/>\n   at Limilabs.Client.SMTP.Smtp.[1](String [1], Boolean<br \/>\n)<br \/>\n   at Limilabs.Client.SMTP.Smtp.LoginDIGEST(String user, String password)<br \/>\n   at Limilabs.Client.SMTP.Smtp.UseBestLogin(String user, String password)<br \/>\n   at ..Forms.ComposeEmailForm.SendEmail()<\/p>\n<p>The SMPT settings are as follows:<\/p>\n<p>Outgoing mail server:  smtp.livemail.co.uk<br \/>\nPort:  587<br \/>\nUse SSL:  false<\/p>\n<\/blockquote>\n<p>After some investigation it turned out that livemail.co.uk incorrectly advertises CRAM-MD5 login method:<\/p>\n<p>The server EHLO response is misleading:<\/p>\n<p><code><br \/>\nS: 250-AUTH LOGIN PLAIN CRAM-MD5 <font style=\"color: red\">DIGEST-MD5<\/font><br \/>\nS: 250-ENHANCEDSTATUSCODES<br \/>\nS: 250-8BITMIME<br \/>\nS: 250-DSN<br \/>\nS: 250 AUTH PLAIN LOGIN CRAM-MD5<\/code><\/p>\n<p>Notice that it sends DIGEST-MD5 in first AUTH response and it doesn&#8217;t send it in the second one. Unfortunately Mail.dll uses the first response and it causes it to use CRAM:<\/p>\n<p><code>C: AUTH DIGEST-MD5<\/code><\/p>\n<p>the command fails, because it&#8217;s most likely not implemented by the server or not turned on:<\/p>\n<p><code>S: 500 5.5.1 Invalid command<\/code><\/p>\n<p>AUTH PLAIN and AUTH LOGIN methods do work without any problems<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing (Smtp client = new Smtp())\r\n{\r\n    client.Connect(&quot;smtp.livemail.co.uk&quot;);\r\n    client.Login(&quot;user&quot;, &quot;pass&quot;);\r\n    \/\/...\r\n    client.Close();\r\n}\r\n<\/pre>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing (Smtp client = new Smtp())\r\n{\r\n    client.Connect(&quot;smtp.livemail.co.uk&quot;);\r\n    client.LoginPLAIN(&quot;user&quot;, &quot;pass&quot;);\r\n    \/\/...\r\n    client.Close();\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Recently one of our clients reported an issue with the SMTP server they use. The problem occurred only in Mail.dll. Outlook was working correctly. The exception we are getting is: Limilabs.Client.ServerException: 5.5.1 Invalid command at Limilabs.Client.SMTP.Smtp.[1](String [1], Boolean ) at Limilabs.Client.SMTP.Smtp.LoginDIGEST(String user, String password) at Limilabs.Client.SMTP.Smtp.UseBestLogin(String user, String password) at ..Forms.ComposeEmailForm.SendEmail() The SMPT settings are [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[98,50],"class_list":["post-4932","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-bug","tag-smtp"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4932"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=4932"}],"version-history":[{"count":10,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4932\/revisions"}],"predecessor-version":[{"id":4942,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4932\/revisions\/4942"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=4932"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=4932"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=4932"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}