{"id":535,"date":"2012-06-09T08:55:47","date_gmt":"2012-06-09T08:55:47","guid":{"rendered":"http:\/\/www.plugged.in\/?p=535"},"modified":"2012-06-09T08:55:47","modified_gmt":"2012-06-09T08:55:47","slug":"directadmin-problem-recieving-emails-the-unknown-user-issue","status":"publish","type":"post","link":"https:\/\/www.veriteknik.net.tr\/en\/directadmin-problem-recieving-emails-the-unknown-user-issue\/","title":{"rendered":"Directadmin : Problem Receiving Emails &#8211; The &#8220;Unknown User&#8221; Issue"},"content":{"rendered":"<p>If you get a <em>550 error<\/em> as a reply when you email a user with directadmin, saying <strong>Remote host said: 550 &#8220;Unknown User&#8221;<\/strong> or <strong>The error that the other server returned was: 550 550 &#8220;Unknown User&#8221; (state 13).<\/strong> or something equivalent, then the problem might be your virtual domainowner settings.<\/p>\n<p>This happens with exim especially when moving from one server to another via Directadmin.<\/p>\n<p>To verify this solution, first check your paniclog:<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">tail \/var\/log\/exim\/paniclog<\/pre>\n<p>If you get something like this:<\/p>\n<blockquote><p>2012-06-08 18:53:01 1SczTF-0002Cj-B8 Failed to find user &#8220;&#8221; from expanded string &#8220;${lookup{$domain}lsearch{\/etc\/virtual\/domainowners}{$value}}&#8221; for the domain_filter router<\/p><\/blockquote>\n<p>then you probably have an issue with your domainowners file. as you can see, the perl script can&#8217;t parse the <em>username<\/em>, hence the error &#8220;unknown user&#8221; when receiving email.<\/p>\n<p>The solution is to rebuild the \/etc\/virtual directory<\/p>\n<p>Get a backup<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">cd \/etc\ncp -Rp virtual virtual.backup<\/pre>\n<p>Verify its existance<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">mkdir -p \/etc\/virtual\nchmod 755 \/etc\/virtual\nchown mail:mail \/etc\/virtual<\/pre>\n<p>Create this script and save it somewhere, let&#8217;s say \/root\/fix_virtual.sh<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">#!\/bin\/sh\n\necho -n '' &gt; \/etc\/virtual\/domains\necho -n '' &gt; \/etc\/virtual\/domainowners\n\nmkdir -p \/etc\/virtual\/`hostname`\nchown mail:mail \/etc\/virtual\/`hostname`\nchmod 711 \/etc\/virtual\/`hostname`\necho `hostname` &gt;&gt; \/etc\/virtual\/domains\n\nfor u in `ls \/usr\/local\/directadmin\/data\/users`; do\n{\n       for d in `cat \/usr\/local\/directadmin\/data\/users\/$u\/domains.list`; do\n       {\n               echo \"$d: $u\" &gt;&gt; \/etc\/virtual\/domainowners\n               echo \"$d\" &gt;&gt; \/etc\/virtual\/domains\n\n               DMN=\/etc\/virtual\/$d\n\n               mkdir -p $DMN\n               chmod 711 $DMN\n               chown mail:mail $DMN\n\n               touch $DMN\/aliases\n               if [ ! -s $DMN\/aliases ]; then\n                       echo \"$u: $u\" &gt; $DMN\/aliases\n               fi\n               touch $DMN\/autoresponder.conf\n               touch $DMN\/filter\n               touch $DMN\/filter.conf\n               touch $DMN\/passwd\n               touch $DMN\/quota\n               touch $DMN\/vacation.conf\n               chown mail:mail $DMN\/*\n\n               mkdir -p $DMN\/majordomo\n               chmod 751 $DMN\/majordomo\n               chown majordomo:daemon $DMN\/majordomo\n\n               mkdir -p $DMN\/reply\n               chmod 700 $DMN\/reply\n               chown mail:mail $DMN\/reply\n\n               for p in `cat \/usr\/local\/directadmin\/data\/users\/$u\/domains\/$d.pointers 2&gt;\/dev\/null`; do\n               {\n                       echo \"$p: $u\"  &gt;&gt; \/etc\/virtual\/domainowners\n                       echo \"$p\" &gt;&gt; \/etc\/virtual\/domains\n                       ln -s $d \/etc\/virtual\/$p\n               };\n               done;\n       }\n       done;\n}\ndone;\n\nchown mail:mail \/etc\/virtual\/domains\nchown mail:mail \/etc\/virtual\/domainowners\nchmod 644 \/etc\/virtual\/domainowners\nchmod 644 \/etc\/virtual\/domains<\/pre>\n<p>Make it exacutable and run.<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">chmod 755 \/root\/fix_virtual.sh\n\/root\/fix_virtual.sh<\/pre>\n<p>Restart exim services<\/p>\n<pre class=\"brush: bash; gutter: true; first-line: 1\">service exim restart<\/pre>\n<p>Your problem should be fixed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you get a 550 error as a reply when you email a user with directadmin, saying Remote host said: 550 &#8220;Unknown User&#8221; or The error that the other server returned was: 550 550 &#8220;Unknown User&#8221; (state 13). or something equivalent, then the problem might be your virtual domainowner settings. This happens with exim especially [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","footnotes":""},"categories":[461],"tags":[455,533,458],"yst_prominent_words":[],"class_list":["post-535","post","type-post","status-publish","format-standard","hentry","category-directadmin-linux","tag-directadmin","tag-email","tag-exim"],"jetpack_featured_media_url":"","uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"Mustafa Emre Ayd\u0131n","author_link":"https:\/\/www.veriteknik.net.tr\/en\/author\/eaydin\/"},"uagb_comment_info":0,"uagb_excerpt":"If you get a 550 error as a reply when you email a user with directadmin, saying Remote host said: 550 &#8220;Unknown User&#8221; or The error that the other server returned was: 550 550 &#8220;Unknown User&#8221; (state 13). or something equivalent, then the problem might be your virtual domainowner settings. This happens with exim especially&hellip;","_links":{"self":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/535","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/comments?post=535"}],"version-history":[{"count":0,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/posts\/535\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/media?parent=535"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/categories?post=535"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/tags?post=535"},{"taxonomy":"yst_prominent_words","embeddable":true,"href":"https:\/\/www.veriteknik.net.tr\/en\/wp-json\/wp\/v2\/yst_prominent_words?post=535"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}