{"id":1397,"date":"2010-03-26T22:10:21","date_gmt":"2010-03-26T14:10:21","guid":{"rendered":"http:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=1397"},"modified":"2010-03-27T12:09:22","modified_gmt":"2010-03-27T04:09:22","slug":"how-to-avoid-backscatter-in-sendmail","status":"publish","type":"post","link":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/?p=1397","title":{"rendered":"How to avoid Backscatter in Sendmail"},"content":{"rendered":"<p>Taken from <a href=\"http:\/\/elqui.dcsc.utfsm.cl\/util\/email\/backscatter.html\">http:\/\/elqui.dcsc.utfsm.cl\/util\/email\/backscatter.html<\/a><\/p>\n<p><span style=\"font-family: Arial,Helvetica,sans-serif;\">Your MX servers should reject  email for unknown users at the SMTP initial transaction and NOT forward  them to internal SMTP servers without a &#8220;user check&#8221;. <\/span><\/p>\n<ul>\n<li><span style=\"font-family: Arial,Helvetica,sans-serif;\"><strong><span style=\"color: #ff0000;\">Step1<\/span><\/strong><\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-size: x-small;\">: <\/span><span>In <strong>MX SERVER, <\/strong>add  these 4 lines to your &#8220;.<strong>mc<\/strong>&#8221; file in the right place..<br \/>\nFEATURE(access_db, hash -T&lt;TMPF&gt; \/etc\/mail\/access)dnl<br \/>\nFEATURE(`blacklist_recipients&#8217;)dnl<br \/>\ndefine(`VIRTUSER_TABLE&#8217;, `hash -o  \/etc\/mail\/virtusertable&#8217;)dnl<br \/>\nVIRTUSER_DOMAIN_FILE(`\/etc\/mail\/virtuserdomain&#8217;)dnl<\/p>\n<p><\/span><\/li>\n<\/ul>\n<ul>\n<li><span style=\"font-family: Arial,Helvetica,sans-serif;\"><strong><span style=\"color: #ff0000;\">Step2<\/span><\/strong><\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-size: x-small;\">: <\/span><span>In <strong>MX SERVER, <\/strong> put YOUR internal valid domains in <strong>\/etc\/mail\/virtuserdomain<\/strong><br \/>\n#<br \/>\nexample.com<br \/>\nmy.org<br \/>\n<\/span> <span style=\"font-family: Courier New,Courier,mono; font-size: x-small;\"><br \/>\n<\/span><\/li>\n<li><span style=\"font-family: Arial,Helvetica,sans-serif;\"><strong><span style=\"color: #ff0000;\">Step3<\/span><\/strong><\/span><span style=\"font-family: Arial,Helvetica,sans-serif; font-size: x-small;\">: <\/span><span style=\"font-family: Arial,Helvetica,sans-serif;\"><span>In <strong>MX SERVER<\/strong>, add these  lines to your &#8220;<a href=\"http:\/\/www.sendmail.org\/m4\/anti_spam.html#access_db\"><strong>access<\/strong><\/a>&#8221;  file <strong>(\/etc\/mail\/access)<\/strong><\/span>:<br \/>\n&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-insert into access  file&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<span style=\"font-family: Courier New,Courier,mono;\"># list of internal domains  that have their own servers<br \/>\n#     and you do not serve them. Your server only receives email<br \/>\n#      from them.<br \/>\n# equal to &#8220;internal domains that you receive email via MX&#8221;<br \/>\n<strong>From:marketing.my.org\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 OK<br \/>\nFrom:marketing.example.com\u00a0\u00a0\u00a0 OK<br \/>\n<\/strong><br \/>\n<\/span><\/span><span style=\"font-family: Courier New,Courier,mono;\">######################<br \/>\n# <strong>Reject Forgery<\/strong> &#8211; Not requiered for  Backscattering<br \/>\n######################<br \/>\n# FOR TEST USE: \/usr\/lib\/sendmail -bt<br \/>\n# check_mail &lt;valid.user@example.com&gt; &#8211;&gt; ACCESS  DENIED<br \/>\n<strong>From:example.com\u00a0\u00a0\u00a0\u00a0\u00a0 REJECT<br \/>\n<\/strong># check_mail &lt;valid.user@my.org&gt; &#8211;&gt;  ACCESS DENIED<br \/>\n<strong>From:my.org\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 REJECT<br \/>\n<\/strong><br \/>\n######################<br \/>\n## <strong>Reject Backscatter<\/strong>&#8230;.<br \/>\n# reject unknown recipients, because SPAMMERS<br \/>\n# use this to spam other domains through bounces<br \/>\n#              messages (user unknown).<br \/>\n#<br \/>\n##############################################<br \/>\n# general rejection strings<br \/>\n<strong>To:example.com\u00a0\u00a0\u00a0\u00a0 error:5.1.1:&#8221;550 User unknown&#8221;<br \/>\nTo:my.org\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 error:5.1.1:&#8221;550 User unknown&#8221;<br \/>\n<\/strong>#<br \/>\n################################################<br \/>\n# List ALL valid internal EMAIL addresses<br \/>\n# If not listed here, sender server will get a &#8220;550 User  unknown&#8221;<br \/>\n# you should use a shell script to help you build<br \/>\n# this list each time you create a user.<br \/>\n#<br \/>\n<strong>To:john.doe@example.com\u00a0\u00a0\u00a0 RELAY<br \/>\nTo:jane.joe@my.org\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<br \/>\nTo:postmaster@example.com\u00a0 RELAY<br \/>\n<\/strong>etc&#8230;<br \/>\n<\/span><span style=\"font-family: Arial,Helvetica,sans-serif;\"> &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-end inserto into  access&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br \/>\n<\/span><\/li>\n<li><span style=\"font-family: Arial,Helvetica,sans-serif;\"><strong><span style=\"color: #ff0000;\">Step4<\/span><\/strong>:  <span>In <\/span><strong>MX  SERVER<\/strong><span>, <\/span><strong>regenerate<\/strong> your &#8220;sendmail.cf&#8221; and <strong>re-makemap<\/strong> your &#8220;<a href=\"http:\/\/www.sendmail.org\/m4\/anti_spam.html#access_db\">access<\/a>&#8221;  database\n<p><\/span><\/li>\n<li><span style=\"font-family: Arial,Helvetica,sans-serif;\"><strong><span style=\"color: #ff0000;\">Step5<\/span><\/strong>:  <span>In<\/span><strong> MX SERVER<\/strong><span>, <\/span><strong>TEST the  configuration using an external IP address (in this example 200.89.70.8  mx.uchile.cl):<\/strong><strong>$ \/usr\/lib\/sendmail -bt -d21.4<br \/>\n<\/strong> .D{client_addr}200.89.70.8<br \/>\n.D{client_name}mx.uchile.cl<\/p>\n<p>check_rcpt &lt;john.doe@example.com&gt;<br \/>\n# should produce a &#8212;&gt; RELAY<\/p>\n<p>check_rcpt &lt;user.notexist@example.com&gt;<br \/>\n# should produce a &#8212;&gt; &#8220;550 User unknown<\/p>\n<p><\/span><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Taken from http:\/\/elqui.dcsc.utfsm.cl\/util\/email\/backscatter.html<\/p>\n<p>Your MX servers should reject email for unknown users at the SMTP initial transaction and NOT forward them to internal SMTP servers without a &#8220;user check&#8221;. <\/p>\n<p> Step1: In MX SERVER, add these 4 lines to your &#8220;.mc&#8221; file in the right place.. FEATURE(access_db, hash -T&lt;TMPF&gt; \/etc\/mail\/access)dnl FEATURE(`blacklist_recipients&#8217;)dnl define(`VIRTUSER_TABLE&#8217;, `hash -o \/etc\/mail\/virtusertable&#8217;)dnl [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[3],"tags":[65],"class_list":["post-1397","post","type-post","status-publish","format-standard","hentry","category-computer","tag-mail","odd"],"_links":{"self":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1397","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1397"}],"version-history":[{"count":3,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1397\/revisions"}],"predecessor-version":[{"id":1400,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1397\/revisions\/1400"}],"wp:attachment":[{"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1397"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1397"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/staff.ie.cuhk.edu.hk\/~sfluk\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1397"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}