{"id":4278,"date":"2013-09-27T12:52:43","date_gmt":"2013-09-27T10:52:43","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=4278"},"modified":"2018-08-06T17:26:04","modified_gmt":"2018-08-06T15:26:04","slug":"tried-to-read-a-line-only-received","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/tried-to-read-a-line-only-received","title":{"rendered":"Tried to read a line. Only &#8221; received."},"content":{"rendered":"<h2>Mail.dll<\/h2>\n<p>If you are using <a href=\"\/mail\">Mail.dll<\/a>:<\/p>\n<p>Please make sure that you have <strong>disabled antivirus and firewall software<\/strong> or that you have configured them correctly. <\/p>\n<p>This includes <strong>Windows Defender<\/strong> &#8211; especially if you use SMTP client. <\/p>\n<p>Many reports show that <strong>AVG<\/strong> antivirus tracks IMAP sessions and interrupts them with no reason.<\/p>\n<p>Similarly <strong>Norton Security<\/strong> scans outgoing messages (&#8216;Scan outgoing email messages&#8217; feature is on even when antivirus is disabled) and breaks as it has incorrectly implemented CHUNKING mechanism.<\/p>\n<p>Some <strong>Cisco Pix<\/strong> and <strong>Cisco ASA firewall<\/strong> may interfere with SMTP traffic when SMTP Packet Inspection is on.<\/p>\n<p>In most such cases turning on SSL\/TLS prevents external programs from snooping and breaking the traffic.<\/p>\n<p>Generally &#8216;Tried to read a line.&#8217; error means that the connection was interrupted. It was lost, the server disconnected or your antivirus\/firewall cut the connection. For instance: SMTP server may be configured to disconnect as soon as it decides your message is spam or when you are using incorrect from address.<\/p>\n<p>In technical terms, it means exactly what the exception&#8217;s message says: component tried to read a line (ending with CRLF), the line was expected in accordance to the protocol in use, but it has not been received during the specified period.<\/p>\n<p>On extremely slow networks you may increase timeout values: <em>ReceiveTimeout<\/em> and <em>SendTimeout<\/em>.<\/p>\n<p>If increasing timeout values doesn&#8217;t help, it means that the connection was dropped by the remote server or some intermediary router &#8211; you&#8217;ll need to connect again.<\/p>\n<p>If you are using *Imap.Idle* you can use lower IDLE timeout. It specifies timeout after which IDLE command is re-issued. This breaks inactivity period (which happens when no new message is delivered) and thus prevents routers from cutting the connection.<\/p>\n<h2>Mail.dll for Windows Store <\/h2>\n<p>If you are using <a href=\"\/mail\">Mail.dll<\/a> for windows store applications: <em>Connect<\/em> and <em>ConnectSSL<\/em> methods are asynchronous. You must use <strong>await<\/strong> ConnectSSL and <strong>await<\/strong> Connect:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C#\r\n\r\nusing(Imap imap = new Imap())\r\n{\r\n    await client.ConnectSSL(&quot;imap.example.com&quot;);\r\n    await client.UseBestLoginAsync(&quot;user&quot;, &quot;password&quot;);\r\n    \/\/ ...\r\n}   \r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET\r\n\r\nUsing imap As New Imap()\r\n    Await client.ConnectSSL(&quot;imap.example.com&quot;)\r\n    Await client.UseBestLoginAsync(&quot;user&quot;, &quot;password&quot;)\r\n    ' ...\r\nEnd Using\r\n<\/pre>\n<p>All points in Mail.dll section apply as well.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Mail.dll If you are using Mail.dll: Please make sure that you have disabled antivirus and firewall software or that you have configured them correctly. This includes Windows Defender &#8211; especially if you use SMTP client. Many reports show that AVG antivirus tracks IMAP sessions and interrupts them with no reason. Similarly Norton Security scans outgoing [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[77,79,97],"class_list":["post-4278","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-imap-component","tag-pop3-component","tag-smtp-component"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4278"}],"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=4278"}],"version-history":[{"count":25,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4278\/revisions"}],"predecessor-version":[{"id":5436,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/4278\/revisions\/5436"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=4278"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=4278"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=4278"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}