{"id":783,"date":"2021-02-10T16:43:08","date_gmt":"2021-02-10T16:43:08","guid":{"rendered":"https:\/\/www.kolkataonweb.com\/code-bank\/?p=783"},"modified":"2021-02-10T13:40:33","modified_gmt":"2021-02-10T13:40:33","slug":"outgoing-email-problem-with-roundcube-ispconfig-3-2-and-ubuntu-20-04-on-aws","status":"publish","type":"post","link":"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/outgoing-email-problem-with-roundcube-ispconfig-3-2-and-ubuntu-20-04-on-aws\/","title":{"rendered":"Outgoing email problem with Roundcube, ISPConfig 3.2 and Ubuntu 20.04 on AWS"},"content":{"rendered":"<p>I had setup an ISPConfig system with Roundcube on Ubuntu 20.04 hosted with AWS EC2.<\/p>\n<p>The setup was all fine, logged in into Roundcube and tried to send a mail. There was the problem &#8211; Roundcube says<span style=\"color: #ff0000;\"> Error 250: Authentication failed.<\/span><\/p>\n<p>It seems others also faced the same issue and different solutions worked for different people. I tested the most popular solutions and below are the results<\/p>\n<ol>\n<li>Changing <span style=\"color: #0000ff;\">$config[&#8216;smtp_port&#8217;] = 587;\u00a0 <span style=\"color: #000000;\">to\u00a0\u00a0<\/span> $config[&#8216;smtp_port&#8217;] = 25; <span style=\"color: #000000;\">in <span style=\"color: #800080;\">\/etc\/roundcube\/config.inc.php <span style=\"color: #000000;\">worked instantly but didn&#8217;t want to send things over plain text port<\/span><\/span><\/span><\/span><\/li>\n<li><span style=\"color: #000000;\">Most popular solution was to remove the values of the below settings in <\/span><span style=\"color: #800080;\">\/etc\/roundcube\/config.inc.php:<\/span><br \/>\n<span style=\"color: #0000ff;\">$config[&#8216;smtp_user&#8217;] = &#8216;%u&#8217;;<\/span><br \/>\n<span style=\"color: #0000ff;\">$config[&#8216;smtp_pass&#8217;] = &#8216;%p&#8217;;<\/span><br \/>\nThe suggested solution is to remove the %u and %p. Though it worked for many but not for me.<\/li>\n<li><span style=\"color: #ff0000;\"><span style=\"color: #000000;\">Tried setting the <span style=\"color: #0000ff;\">$config[&#8216;smtp_server&#8217;] = &#8216;localhost&#8217;;\u00a0 to\u00a0 $config[&#8216;smtp_server&#8217;] = &#8216;tls:\/\/localhost&#8217;;<\/span><br \/>\n<span style=\"color: #0000ff;\">$config[&#8216;default_host&#8217;] = &#8216;localhost&#8217;;\u00a0 to\u00a0 $config[&#8216;default_host&#8217;] = &#8216;tls:\/\/localhost&#8217;;<\/span><\/span><\/span><br \/>\nBut didn&#8217;t work<br \/>\nWith these changes was unable to login to Roundcube.<\/li>\n<li>Tried using <span style=\"color: #0000ff;\">$config[&#8216;smtp_auth_type&#8217;] = &#8216;PLAIN&#8217;;\u00a0<\/span> Didn&#8217;t work.<\/li>\n<li>There were also other suggestions to tweak <span style=\"color: #0000ff;\">smtpd_use_tls, smtpd_sasl_auth_enable,\u00a0 smtpd_tls_auth_only <span style=\"color: #000000;\">etc. But none of these worked either. <\/span><\/span><\/li>\n<li>\n<pre class='wp-code-highlight prettyprint'><strong><span style=\"color: #339966;\"><span style=\"color: #000000;\">The configuration that worked was<\/span> <\/span><\/strong>\r\n\r\n<span style=\"color: #339966;\">$config['default_host'] = 'localhost';<\/span>\r\n<span style=\"color: #339966;\">$config['smtp_server'] = 'tls:\/\/localhost';\r\n$config['smtp_port'] = 587;\r\n$config['smtp_user'] = '%u';\r\n$config['smtp_pass'] = '%p';<\/span>\r\n<span style=\"color: #339966;\">....<\/span>\r\n<span style=\"color: #339966;\">....<\/span>\r\n<span style=\"color: #339966;\">$config['imap_conn_options'] = array(<\/span>\r\n<span style=\"color: #339966;\">   'ssl' =&gt; array(<\/span>\r\n<span style=\"color: #339966;\">      'verify_peer' =&gt; false,<\/span>\r\n<span style=\"color: #339966;\">      'verfify_peer_name' =&gt; false,<\/span>\r\n<span style=\"color: #339966;\">    ),<\/span>\r\n<span style=\"color: #339966;\">);<\/span>\r\n\r\n<span style=\"color: #339966;\">$config['smtp_conn_options'] = array(<\/span>\r\n<span style=\"color: #339966;\">   'ssl' =&gt; array(<\/span>\r\n<span style=\"color: #339966;\">       'verify_peer' =&gt; false,<\/span>\r\n<span style=\"color: #339966;\">       'verify_peer_name' =&gt; false,<\/span>\r\n<span style=\"color: #339966;\">    ),<\/span>\r\n<span style=\"color: #339966;\">);<\/span><\/pre>\n<p>Which indicates it was a SSL issue. But changing the default SSL set by Postfix is a lot work, someday will delve into it.<\/li>\n<\/ol>\n<p>There was another issue due to which mails were not going out sometimes. The error was &#8220;<em><span style=\"color: #ff6600;\">Our<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\">system has detected that 550-5.7.1 this message does not meet IPv6 sending<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\">guidelines regarding PTR 550-5.7.1 records and authentication. Please<\/span><\/em><br \/>\n<em><span style=\"color: #ff6600;\">review 550-5.7.1<\/span><\/em>&#8221;<\/p>\n<p>Needed to set<br \/>\ni<span style=\"color: #0000ff;\">net_protocols = all\u00a0 to\u00a0 inet_protocols = ipv4<\/span> in <span style=\"color: #800080;\">\/etc\/postfix\/main.cf\u00a0 <\/span>to force Postfix to use IPv4 only<span style=\"color: #800080;\"><br \/>\n<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I had setup an ISPConfig system with Roundcube on Ubuntu 20.04 hosted with AWS EC2. The setup was all fine, logged in into Roundcube and tried to send a mail. There was the problem &#8211; Roundcube says Error 250: Authentication failed. It seems others also faced the same issue and different solutions worked for different&hellip; <a class=\"more-link\" href=\"https:\/\/www.kolkataonweb.com\/code-bank\/miscellaneous\/outgoing-email-problem-with-roundcube-ispconfig-3-2-and-ubuntu-20-04-on-aws\/\">Continue reading <span class=\"screen-reader-text\">Outgoing email problem with Roundcube, ISPConfig 3.2 and Ubuntu 20.04 on AWS<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-783","post","type-post","status-publish","format-standard","hentry","category-miscellaneous","entry"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/783","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/comments?post=783"}],"version-history":[{"count":4,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/783\/revisions"}],"predecessor-version":[{"id":788,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/posts\/783\/revisions\/788"}],"wp:attachment":[{"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/media?parent=783"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/categories?post=783"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kolkataonweb.com\/code-bank\/wp-json\/wp\/v2\/tags?post=783"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}