{"id":4356,"date":"2017-07-05T22:36:29","date_gmt":"2017-07-05T22:36:29","guid":{"rendered":"https:\/\/www.kevinmaschke.com\/?p=4356\/"},"modified":"2017-07-05T22:36:29","modified_gmt":"2017-07-05T22:36:29","slug":"user-unknown-virtual-alias-table-error-postfix-virtualmin","status":"publish","type":"post","link":"https:\/\/www.kevinmaschke.com\/en\/user-unknown-virtual-alias-table-error-postfix-virtualmin\/","title":{"rendered":"&#8220;User unknown in virtual alias table&#8221; Error in Postfix and Virtualmin"},"content":{"rendered":"<p style=\"text-align: justify;\"><strong>I recently came accross a strange issue with <a href=\"http:\/\/www.postfix.org\/\" target=\"_blank\" rel=\"noopener\">Postfix<\/a> and <a href=\"https:\/\/www.virtualmin.com\/\" target=\"_blank\" rel=\"noopener\">Virtualmin<\/a> on every website hosted on my server when someone tried to send a mail using a contact form<\/strong>. The websites stated that the email had been sent correctly, but the email never reached the inbox.<\/p>\n<p style=\"text-align: justify;\">Checking the logs in\u00a0<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/var\/log\/mail.log<\/code>\u00a0I saw that the emails were not being sent and that the following error message was being written to the logs:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-highlight=\"4\">Jun 21 09:39:32 server postfix\/pickup[74857]: 82A542019B6: uid=1007 from=&lt;domain&gt;\r\nJun 21 09:39:32 server postfix\/cleanup[76834]: 82A542019B6: message-id=&lt;5cc7985adece5aec72a03de385612e5d@www.domain.com&gt;\r\nJun 21 09:39:32 server postfix\/qmgr[1746]: 82A542019B6: from=&lt;domain@server.host.com&gt;, size=790, nrcpt=1 (queue active)\r\nJun 21 09:39:32 server postfix\/error[76836]: 82A542019B6: to=&lt;info@domain.com&gt;, relay=none, delay=0.09, delays=0.04\/0\/0\/0.05, dsn=5.1.1, status=bounced (User unknown in virtual alias table)<\/pre>\n<p style=\"text-align: justify;\">Postfix was bouncing the emails with a &#8220;<strong><em>User unknown in virtual alias table<\/em><\/strong>&#8221; error.<\/p>\n<p style=\"text-align: justify;\"><strong>I searched the web and did various tests<\/strong> following the recommendations and steps I found on the official Virtualmin forums, changing the configuration of Postfix, checking and changing the domain configuration within Virtualmin and even changing some settings through Webmin, but the error persisted.<\/p>\n<h2>Cause and solution!<\/h2>\n<p style=\"text-align: justify;\">Finally, I found out that if you send a mail from a website that&#8217;s hosted on Virtualmin, <strong>the server will always first look if the destination domain you&#8217;re sending the mail to exists in Virtualmin on the local server<\/strong>. If it does, it&#8217;ll try to send the domain to the specified account, which will probably not exist (unless you&#8217;re also using Virtualmin as mail server) and fail.<\/p>\n<p style=\"text-align: justify;\">Since I do not use Virtualmin as a mail server but only as a web server, <strong>it&#8217;s possible to fix the problem by disabling the following options<\/strong> in &#8220;Virtualmin &gt; Domain &gt; Edit Virtual Server &gt; Enabled Features&#8221;:<\/p>\n<ul style=\"text-align: justify;\">\n<li style=\"text-align: justify;\">Mail for Domain<\/li>\n<li style=\"text-align: justify;\">Spam Filtering<\/li>\n<li style=\"text-align: justify;\">Virus Filtering<\/li>\n<\/ul>\n<p><a href=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-large wp-image-4343 aligncenter\" src=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-1024x344.jpg\" alt=\"\" width=\"1024\" height=\"344\" srcset=\"https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-1024x344.jpg 1024w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-400x134.jpg 400w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-100x34.jpg 100w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-1536x516.jpg 1536w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-406x136.jpg 406w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-883x297.jpg 883w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config-1513x509.jpg 1513w, https:\/\/cdn.kevinmaschke.com\/wp-content\/uploads\/2017\/07\/02212722\/virtual_server_config.jpg 1770w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>It&#8217;s important to disable all three options<\/strong>, because if not the mail functions for the domain will still partially be enabled and the error will continue to occur.<\/p>\n<p style=\"text-align: justify;\">Once the options are disabled and the configuration has been saved, it&#8217;s advisable to reload Postfix to make sure it applies the new configuration:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/etc\/init.d\/postfix reload<\/pre>\n<p style=\"text-align: justify;\">In case you use Virtualmin also as a mail server, the problem will most probably be that the email account you&#8217;re trying to send the email to does not exist for the domain and has to be created.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I recently came accross a strange issue with Postfix and Virtualmin on every website hosted on my server when someone tried to send a mail using a contact form. The websites stated that the email &#8230;<\/p>\n","protected":false},"author":1,"featured_media":4350,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[207,225],"tags":[639,1695,645,1690,1691],"class_list":["post-4356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-linux-en","category-web-en","tag-email","tag-linux-en","tag-open-source-en","tag-postfix-en","tag-virtualmin-en"],"acf":{"book_cover":null,"special_featured_image":null},"_links":{"self":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/4356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/comments?post=4356"}],"version-history":[{"count":0,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/posts\/4356\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media\/4350"}],"wp:attachment":[{"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/media?parent=4356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/categories?post=4356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kevinmaschke.com\/en\/wp-json\/wp\/v2\/tags?post=4356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}