{"id":1614,"date":"2023-02-19T20:41:00","date_gmt":"2023-02-20T02:41:00","guid":{"rendered":"http:\/\/www.supportpro.com\/blog\/?p=1614"},"modified":"2023-02-20T10:51:06","modified_gmt":"2023-02-20T16:51:06","slug":"outgoing-mail-issue-in-qmail-using-configured-smtp-routes","status":"publish","type":"post","link":"https:\/\/www.supportpro.com\/blog\/outgoing-mail-issue-in-qmail-using-configured-smtp-routes\/","title":{"rendered":"Outgoing mail issue in Qmail using configured SMTP routes"},"content":{"rendered":"\n<p>If you&#8217;re having issues with outgoing mail service in Linux-Qmail server, where all outgoing emails or emails to any specific domain are getting stuck in the remote queue, don&#8217;t worry. In this article, we provide a step-by-step solution to resolve the issue. <\/p>\n\n\n\n<p>The article details the issue and error message, as well as provides a resolution that includes checking the Qmail-SMTP routing, verifying connectivity to the host mentioned as a relay, and restarting the Qmail service. We also provide guidance on checking the mail log and Qmail queue to ensure that the mail is being delivered and on how to force-run the mail queue if required. <\/p>\n\n\n\n<p>Read on for simple solutions that will help you deliver emails from your server without any further issues.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">The <span style=\"text-decoration: underline;\">Issue <\/span><\/h2>\n\n\n\n<p>Outgoing mails getting queued in remote queue with below error in the server mail log (\/usr\/local\/psa\/var\/log\/maillog) :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>==========\n<strong>delivery 24075 : deferral: Sorry,_I_wasn't_able_to_establish_an_SMTP_connection._(#4.4.1)\/<\/strong>\n<strong>qmail: xxxxxx.xxxxxxx status: local 0\/10 remote 0\/20<\/strong>\n==========<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Resolution <\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>1] Have\u00a0 a check with the Qmail-SMTP routing <\/strong><\/h3>\n\n\n\n<p>The Qmail-SMTP relay file is \/var\/qmail\/control\/smtproutes<\/p>\n\n\n\n<p><em># cat \/var\/qmail\/control\/smtproutes<\/em><\/p>\n\n\n\n<p><em>&nbsp;&nbsp;&nbsp; #host.com: &lt;IP&gt;<\/em><br><em>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :host3.com<\/em><\/p>\n\n\n\n<p>The record `:host3.com` means that all messages, regardless of the destination domain, are relayed to `host3.com`.<br>host.com: &lt;IP&gt; (if uncommented) means that all messages to the domain \u2018host.com\u2019 from the server are relayed through xxx.xxx.xxx.xxx<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">2] Next, check the connectivity to the host mentioned as relay<\/h2>\n\n\n\n<p>We can do a telnet to the SMTP port 25 to verify the connectivity.<\/p>\n\n\n\n<p><em># telnet host3.com 25<\/em><br><em>&nbsp;&nbsp;&nbsp; Trying &#8230;<\/em><br><em>&nbsp;&nbsp;&nbsp; telnet: connect to address &lt;IP&gt;: Connection timed out<\/em><br><em>&nbsp;&nbsp;&nbsp; telnet: Unable to connect to remote host: Connection timed out<\/em><\/p>\n\n\n\n<p><strong>2.1] If the connection is timed out (as above), please, comment out the line with the remote server:<\/strong><\/p>\n\n\n\n<p><em># cat \/var\/qmail\/control\/smtproutes<\/em><\/p>\n\n\n\n<p><em>\u00a0\u00a0\u00a0 #host.com: &lt;IP><\/em><br><em>\u00a0\u00a0\u00a0 #:host3.com<\/em><\/p>\n\n\n\n<p><strong>2.2] If the connection to the relay host is established, verify that the IP address used to send emails is not blacklisted on the destination host:<\/strong><\/p>\n\n\n\n<p><em># dig mx &lt;destination host&gt;<\/em><br><em># telnet &lt;destination mx host&gt; 25<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">3] Restart Qmail service:<\/h2>\n\n\n\n<p><br><em># \/etc\/init.d\/qmail restart<\/em><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">4] Check the maillog and Qmail queue to make sure that mail is being delivered and Qmail queue is decreasing:<\/h2>\n\n\n\n<p><br><em># less \/usr\/local\/psa\/var\/log\/maillog<\/em><br><em># \/var\/qmail\/bin\/qmail-qstat<\/em><\/p>\n\n\n\n<p>If required, run the below command to force run the mailqueue.<\/p>\n\n\n\n<p><em># kill -ALRM `ps ax | grep [q]mail-send | awk &#8216;{print $1}&#8217;`<\/em><\/p>\n\n\n\n<p>The emails should now be delivered immediately from the server !!<\/p>\n\n\n\n<p>If you require help, <a href=\"https:\/\/www.supportpro.com\/requestquote.php\">contact SupportPRO Server Admin<\/a><\/p>\n\n\n\n<div class=\"wp-block-group\"><div class=\"wp-block-group__inner-container is-layout-flow wp-block-group-is-layout-flow\">\n<div class=\"wp-block-media-text alignwide has-media-on-the-right is-stacked-on-mobile is-vertically-aligned-center has-white-background-color has-background\"><div class=\"wp-block-media-text__content\">\n<p class=\"has-large-font-size\">Partner with <strong>SupportPRO<\/strong> for 24\/7 proactive cloud support that keeps your business secure, scalable, and ahead of the curve.<\/p>\n\n\n\n<!--HubSpot Call-to-Action Code --><span class=\"hs-cta-wrapper\" id=\"hs-cta-wrapper-3350a795-db50-482f-9911-301930d1b1be\"><span class=\"hs-cta-node hs-cta-3350a795-db50-482f-9911-301930d1b1be\" id=\"hs-cta-3350a795-db50-482f-9911-301930d1b1be\"><!--[if lte IE 8]><div id=\"hs-cta-ie-element\"><\/div><![endif]--><a href=\"https:\/\/cta-redirect.hubspot.com\/cta\/redirect\/2725694\/3350a795-db50-482f-9911-301930d1b1be\" ><img decoding=\"async\" class=\"hs-cta-img\" id=\"hs-cta-img-3350a795-db50-482f-9911-301930d1b1be\" style=\"border-width:0px;\" src=\"https:\/\/no-cache.hubspot.com\/cta\/default\/2725694\/3350a795-db50-482f-9911-301930d1b1be.png\"  alt=\"Contact Us today!\"\/><\/a><\/span><script charset=\"utf-8\" src=\"https:\/\/js.hscta.net\/cta\/current.js\"><\/script><script type=\"text\/javascript\"> hbspt.cta.load(2725694, '3350a795-db50-482f-9911-301930d1b1be', {\"useNewLoader\":\"true\",\"region\":\"na1\"}); <\/script><\/span><!-- end HubSpot Call-to-Action Code -->\n<\/div><figure class=\"wp-block-media-text__media\"><img fetchpriority=\"high\" decoding=\"async\" width=\"904\" height=\"931\" src=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png\" alt=\"guy server checkup\" class=\"wp-image-12943 size-full\" srcset=\"https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup.png 904w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-291x300.png 291w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-768x791.png 768w, https:\/\/www.supportpro.com\/blog\/wp-content\/uploads\/2022\/09\/Free-server-checkup-585x602.png 585w\" sizes=\"(max-width: 904px) 100vw, 904px\" \/><\/figure><\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;re having issues with outgoing mail service in Linux-Qmail server, where all outgoing emails or emails to any specific domain are getting stuck in the remote queue, don&#8217;t worry.&hellip;<\/p>\n","protected":false},"author":5,"featured_media":13047,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[3],"tags":[83],"class_list":["post-1614","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technical-articles","tag-linux"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/comments?post=1614"}],"version-history":[{"count":4,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1614\/revisions"}],"predecessor-version":[{"id":13048,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/posts\/1614\/revisions\/13048"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media\/13047"}],"wp:attachment":[{"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/media?parent=1614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/categories?post=1614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.supportpro.com\/blog\/wp-json\/wp\/v2\/tags?post=1614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}