{"id":1510,"date":"2020-04-23T23:24:01","date_gmt":"2020-04-23T20:24:01","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=1510"},"modified":"2020-04-23T23:24:01","modified_gmt":"2020-04-23T20:24:01","slug":"debian-postfix-access-list-postxixi-confis","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=1510","title":{"rendered":"Debian &#8211; Postfix &#8211; Access list postxixi confis"},"content":{"rendered":"<p>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:<\/p>\n<div>\n<div class=\"smallfont\">Code:<\/div>\n<pre class=\"bbcodeblock\" dir=\"ltr\"><strong>smtpd_sender_restrictions = hash:\/etc\/postfix\/access\r\nreject_unauth_destination = hash:\/etc\/postfix\/access<\/strong><\/pre>\n<\/div>\n<p>Once this has been added to the main.cf, 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\"><strong>aol.com     REJECT\r\nyahoo.com   REJECT\r\nmsn.com     REJECT<\/strong><\/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\"><strong>postmap hash:\/etc\/postfix\/access<\/strong><\/pre>\n<\/div>\n<p>and finally <strong>restart postfix<\/strong>.<\/p>\n<p>This will prevent the offending domains from sending you mail and your users from sending mail to those domains.<\/p>\n<p><b>**NOTE**<\/b>I have used smtpd_sender_restrictions in past configurations, I have not used reject_unauth_destination, and based that portion of this reply on what I read on the postfix site. You may want to impliment each one seperately and test.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 entries in it like [&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-1510","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1510","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=1510"}],"version-history":[{"count":1,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1510\/revisions"}],"predecessor-version":[{"id":1511,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1510\/revisions\/1511"}],"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=1510"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}