{"id":717,"date":"2017-03-27T12:13:52","date_gmt":"2017-03-27T09:13:52","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=717"},"modified":"2017-03-27T12:13:52","modified_gmt":"2017-03-27T09:13:52","slug":"debian-8-how-to-block-domains-postfix","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=717","title":{"rendered":"Debian 8 &#8211; How To Block Domains (Postfix)"},"content":{"rendered":"<div class=\"smallfont\"><strong>If you are sure&#8230;<\/strong><\/div>\n<hr size=\"1\" \/>\n<div id=\"post_message_3349097\">So, if you are sure you want to block all mail to\/from the list of domains, you can add the following directive to your postfix <span class=\"skimlinks-unlinked\">main.cf<\/span> file:<\/p>\n<div>\n<div class=\"smallfont\">Code:<\/div>\n<pre class=\"bbcodeblock\" dir=\"ltr\">smtpd_sender_restrictions = hash:\/etc\/postfix\/access\r\nreject_unauth_destination = hash:\/etc\/postfix\/access<\/pre>\n<\/div>\n<p>Once this has been added to the <span class=\"skimlinks-unlinked\">main.cf<\/span>, you need to create the \/etc\/postfix\/access file and put entries in it like this:<\/p>\n<div>\n<div class=\"smallfont\">Code:<\/div>\n<pre class=\"bbcodeblock\" dir=\"ltr\"><span class=\"skimlinks-unlinked\">aol.com<\/span>     REJECT\r\n<span class=\"skimlinks-unlinked\">yahoo.com<\/span>   REJECT\r\n<span class=\"skimlinks-unlinked\">msn.com<\/span>     REJECT<\/pre>\n<\/div>\n<p>So on and so forth until all the domains have been entered. Once you have created this file and the permissions are correct run the following command:<\/p>\n<div>\n<div class=\"smallfont\">Code:<\/div>\n<pre class=\"bbcodeblock\" dir=\"ltr\">postmap hash:\/etc\/postfix\/access<\/pre>\n<\/div>\n<p>and finally restart postfix.<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>If you are sure&#8230; So, if you are sure you want to block all mail to\/from the list of domains, you can add the following directive to your postfix main.cf file: Code: smtpd_sender_restrictions = hash:\/etc\/postfix\/access reject_unauth_destination = hash:\/etc\/postfix\/access Once this has been added to the main.cf, you need to create the \/etc\/postfix\/access file and put [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":621,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-717","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=717"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/717\/revisions"}],"predecessor-version":[{"id":718,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/717\/revisions\/718"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/621"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}