{"id":119,"date":"2017-10-09T05:59:00","date_gmt":"2017-10-09T05:59:00","guid":{"rendered":"https:\/\/linuxadmin.melberi.com\/uncategorized\/disable-or-enable-open-relay-in"},"modified":"2017-10-09T10:46:09","modified_gmt":"2017-10-09T10:46:09","slug":"disable-or-enable-open-relay","status":"publish","type":"post","link":"https:\/\/www.melberi.com\/linuxadmin\/sendmail\/disable-or-enable-open-relay","title":{"rendered":"Disable or Enable open relay in Sendmail"},"content":{"rendered":"<p>How to Disable or Enable open relay in sendmail SMTP<\/p>\n<h2><span style=\"text-decoration: underline;\">Sendmail Open relay<\/span><\/h2>\n<p>Open relay is disabled by default in Sendmail 8.9 and above.<br \/>\nIt will only allow relaying from localhost.<br \/>\nYou can edit the sendmail access database\u00a0 ( \/etc\/mail\/access) and enable or disable open relay.<\/p>\n<p><b>Default Configuration: <\/b><\/p>\n<div style=\"background-color: #cccccc;\"><b>#vim \/etc\/mail\/access<\/b><\/div>\n<p><span style=\"color: #808080;\"><b>Connect:localhost.localdomain\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<br style=\"background-color: #cccccc;\" \/>Connect:localhost\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<br style=\"background-color: #cccccc;\" \/>Connect:127.0.0.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<\/b><\/span><br \/>\n<b><br \/>\n<\/b><br \/>\nYou can use host name or ip address in the access database<br \/>\n<strong><span style=\"color: #808080;\">youordomain.com \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY <\/span><\/strong><br \/>\n<strong><span style=\"color: #808080;\"> 10.5.10.5 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 \u00a0 RELAY<\/span> <\/strong><br style=\"background-color: #cccccc;\" \/><strong><span style=\"color: #808080;\">spam@buyme.com \u00a0\u00a0\u00a0 \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 550 Spammers not allowed<\/span><\/strong><br style=\"background-color: #cccccc;\" \/><strong><span style=\"color: #808080;\">virus@virusdomain.com\u00a0\u00a0\u00a0 DISCARD<\/span><\/strong><\/p>\n<p><b><\/b><br \/>\n<b>To Reject Mail Form Particular Host\/IP<\/b><\/p>\n<p><span style=\"color: #808080;\"><b>rejectserver.com\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 REJECT<\/b><\/span><br \/>\n<span style=\"color: #808080;\"> <b>10.10.2.2\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0 \u00a0 REJECT<\/b><\/span><br \/>\n<b><br \/>\n<\/b><\/p>\n<h3><span style=\"text-decoration: underline;\"><b>Open Relay:<\/b><\/span><\/h3>\n<p>Open Relay servers will be configured to relay all ip range<br \/>\nBy adding the *.* entry in \/etc\/mail\/access you can enable relay for all<\/p>\n<div style=\"background-color: #cccccc;\"><b>*.*\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<\/b><\/div>\n<p>Also by adding your domain name in the \/etc\/mail\/relay-domains you can enable relay form particular domain server.<br \/>\nNow a days most of the mail servers will not allow mails from open relay servers.<\/p>\n<h3><span style=\"text-decoration: underline;\">How t<b>o Disable Sendmail OPEN Relay<\/b><\/span><\/h3>\n<p>By allowing relay from only your local ip range and localhost, you can disable the open relay.<br \/>\n<b>127.0.0.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<\/b><br \/>\n<b>192.168.1\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 RELAY<\/b><br \/>\nIf your server is configured with<b> smtp auth or POP-before-SMTP<\/b>, then you can remove all the relay entries (Even local ip range) in the access database.<br \/>\nIt is always better to configure your server with <b>smtp auth<\/b> or <b>POP-before-SMTP<\/b> . This will be useful for roaming users also.<\/p>\n<p>Also check \/etc\/mail\/relay-domains and remove all the relay domains<\/p>\n<p>In some cases relaying is allowed even though it isn&#8217;t intended. This is because of the use of FEATURE(relay_entire_domain) which allows relaying for every system in class m. If class m is wrong, then the system may open up relaying for other hosts in that domain. You have to verify this<br \/>\n<b>echo &#8216;$=m&#8217; | sendmail -bt -d0.4<\/b><br \/>\nSometimes class m is set wrong to be just a TLD (e.g., com). In this case, fix your hostname to be host.sld.tld instead of sld.tld or change $m, or remove FEATURE(relay_entire_domain) and use other means instead<\/p>\n<p><b>Open Relay Testing Websites:<\/b><\/p>\n<p><a href=\"http:\/\/www.abuse.net\/relay.html\" target=\"_blank\" rel=\"noopener\">http:\/\/www.abuse.net\/relay.html<\/a><br \/>\n<a href=\"http:\/\/www.mob.net\/%7Eted\/tools\/relaytester.php3\" target=\"_blank\" rel=\"noopener\">http:\/\/www.mob.net\/~ted\/tools\/relaytester.php3<\/a><br \/>\n<a href=\"http:\/\/www.checkor.com\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.checkor.com\/<\/a><\/p>\n<p>MX Tool<br \/>\n<a href=\"http:\/\/www.mxtoolbox.com\/\" target=\"_blank\" rel=\"noopener\">http:\/\/www.mxtoolbox.com\/<\/a><br \/>\n<b><a href=\"http:\/\/www.qmailrocks.org\/smtpauth.htm\" target=\"_blank\" rel=\"noopener\">smtp authentication vs. pop before smtp<\/a><\/b><\/p>\n<p><b>\u00a0<\/b><\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to Disable or Enable open relay in sendmail SMTP Sendmail Open relay Open relay is disabled by default in Sendmail 8.9 and above. It will only allow relaying from&#8230; <a href=\"https:\/\/www.melberi.com\/linuxadmin\/sendmail\/disable-or-enable-open-relay\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/119"}],"collection":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/comments?post=119"}],"version-history":[{"count":4,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/119\/revisions"}],"predecessor-version":[{"id":586,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/posts\/119\/revisions\/586"}],"wp:attachment":[{"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/media?parent=119"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/categories?post=119"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.melberi.com\/linuxadmin\/wp-json\/wp\/v2\/tags?post=119"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}