{"id":392,"date":"2012-11-13T16:05:52","date_gmt":"2012-11-13T15:05:52","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=392"},"modified":"2012-11-13T16:05:52","modified_gmt":"2012-11-13T15:05:52","slug":"fight-spam-with-sendmail-centos5rhel5","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=392","title":{"rendered":"Fight spam with sendmail (CentOS5\/RHEL5)"},"content":{"rendered":"<p>\n\tHello,\n<\/p>\n<p>\n\tSendmail is a very often used MTA (Mail Transfer Agent) on unix platforms. It implements configurations to do realtime blocklist checks with lists from spamhaus.org or spamcop.net or any other blocklist. Open your <em>\/etc\/mail\/sendmail.mc <\/em>and add following two lines to it:\n<\/p>\n<p>\n\t<em>FEATURE(`enhdnsbl&#39;, `sbl.spamhaus.org&#39;, `&quot;554 Rejected &quot; $&amp;{client_addr} &quot; &#8211; see http:\/\/www.spamhaus.org\/sbl\/&quot;&#39;)dnl<\/em><br \/>\n\t<em>FEATURE(`enhdnsbl&#39;, `bl.spamcop.net&#39;, `&quot;554 Rejected &quot; $&amp;{client_addr} &quot; &#8211; see http:\/\/www.spamcop.net\/bl.shtml&quot;&#39;)dnl<\/em>\n<\/p>\n<p>\n\tPlease remember to put them after this line:<br \/>\n\t<em>include(`\/usr\/lib\/opcenter\/sendmail\/install\/popauth.m4&#39;)<\/em>\n<\/p>\n<p>\n\tIf you do not, the sendmail.cf compilation will fail with an error. Well now it&#39;s time to compile our config file, so type this:\n<\/p>\n<p>\n\t<em># m4 \/etc\/mail\/sendmail.mc &gt; \/etc\/mail\/sendmail.cf<\/em>\n<\/p>\n<p>\n\tand restart the mail server with\n<\/p>\n<p>\n\t<em># service sendmail restart<\/em>\n<\/p>\n<p>\n\tThe advantage of this method is that the email is rejected before it enters the server so it saves bandwidth and cpu ressources. I personnally disabled the blocklist checking in MailScanner after using this because i found no need for it anymore.\n<\/p>\n<p>\n\tThere are also a few config options i found useful:\n<\/p>\n<p>\n\t<span style=\"background-color: rgb(249, 249, 249); color: rgb(0, 0, 0); font-family: verdana, arial, sans-serif; font-size: 11px;\">throttle connections to servers which sent out email to more than 10 invalid adresses:<br \/>\n\t<em>define(`confBAD_RCPT_THROTTLE&#39;, `10&#39;)dnl<\/em><\/span>\n<\/p>\n<p>\n\treplace smtp welcome message with a custom string (hides sendmail verison):<br \/>\n\t<em><span style=\"background-color: rgb(249, 249, 249); color: rgb(0, 0, 0); font-family: verdana, arial, sans-serif; font-size: 11px;\">define(`confSMTP_LOGIN_MSG&#39;, `&lt;Your custom string here&gt; MTA, local time is $b&#39;)dnl<\/span><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello, Sendmail is a very often used MTA (Mail Transfer Agent) on unix platforms. It implements configurations to do realtime blocklist checks with lists from spamhaus.org or spamcop.net or any other blocklist. Open your \/etc\/mail\/sendmail.mc and add following two lines to it: FEATURE(`enhdnsbl&#39;, `sbl.spamhaus.org&#39;, `&quot;554 Rejected &quot; $&amp;{client_addr} &quot; &#8211; see http:\/\/www.spamhaus.org\/sbl\/&quot;&#39;)dnl FEATURE(`enhdnsbl&#39;, `bl.spamcop.net&#39;, `&quot;554 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-392","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/392","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=392"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/392\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=392"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=392"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=392"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}