{"id":1743,"date":"2019-07-19T17:57:53","date_gmt":"2019-07-20T00:57:53","guid":{"rendered":"http:\/\/jim-zimmerman.com\/?p=1743"},"modified":"2019-07-19T17:57:53","modified_gmt":"2019-07-20T00:57:53","slug":"spf-verification-in-postfix","status":"publish","type":"post","link":"https:\/\/jim-zimmerman.com\/?p=1743","title":{"rendered":"SPF Verification in Postfix"},"content":{"rendered":"<p>OS: CentOS7<\/p>\n<p>You should have your TXT record set in your DNS prior to implementing this on your server:<br \/>\n&#8220;v=spf1 mx ip4:aaa.bbb.ccc.ddd ip4:eee.fff.ggg.hhh -all&#8221;<\/p>\n<p>Here is link I found useful to understand the options for the DNS record:<br \/>\n<a href=\"https:\/\/support.dnsimple.com\/articles\/spf-record\/\" rel=\"noopener noreferrer\" target=\"_blank\">https:\/\/support.dnsimple.com\/articles\/spf-record\/<\/a><\/p>\n<p>You need to have the EPEL repository enabled to install the pypolicyd-spf package using the methodology I have outlined here.<\/p>\n<p>To install and enable the EPEL repository:<\/p>\n<blockquote><p># yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/p><\/blockquote>\n<p>Install the package Python package:<\/p>\n<blockquote><p># yum install pypolicyd-spf<\/p><\/blockquote>\n<p>Modify the main.cf to add SPF verifcation to postix:<br \/>\nThe master.cf and main.cf need to modified:<\/p>\n<blockquote><p># cd \/etc\/postfix\/<br \/>\n# cp -p master.cf master.cf.20190716<br \/>\n# vi master.cf<br \/>\n&#8230;<br \/>\n<em>policy<\/em> unix &#8211; n n &#8211; 0 spawn user=nobody argv=\/bin\/python \/usr\/libexec\/postfix\/policyd-spf<br \/>\n&#8230;<\/p>\n<p># cp -p main.cf main.cf.20190716<br \/>\n# vi main.cf<br \/>\n&#8230;<br \/>\nsmtpd_recipient_restrictions =<br \/>\n        permit_sasl_authenticated,<br \/>\n        reject_unauth_destination<br \/>\n        check_policy_service unix:private\/<em>policy<\/em><br \/>\n&#8230;<\/p><\/blockquote>\n<p>Note: the <em>policy<\/em> defined in the master.cf does not need to be named &#8220;policy&#8221;.  However, if you change that, you need to also change it in your &#8220;check_policy_service&#8221; statement in the main.cf.<\/p>\n<p>Restart postfix to implement changes:<br \/>\n<em># systemctl restart postfix<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>OS: CentOS7 You should have your TXT record set in your DNS prior to implementing this on your server: &#8220;v=spf1 mx ip4:aaa.bbb.ccc.ddd ip4:eee.fff.ggg.hhh -all&#8221; Here is link I found useful to understand the options for the DNS record: https:\/\/support.dnsimple.com\/articles\/spf-record\/ You need to have the EPEL repository enabled to install the pypolicyd-spf package using the methodology [&#038;hellip<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[40,124,486],"class_list":["post-1743","post","type-post","status-publish","format-standard","hentry","category-documentation","tag-centos","tag-postfix","tag-sfp"],"share_on_mastodon":{"url":"","error":""},"_links":{"self":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1743","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1743"}],"version-history":[{"count":1,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1743\/revisions"}],"predecessor-version":[{"id":1744,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=\/wp\/v2\/posts\/1743\/revisions\/1744"}],"wp:attachment":[{"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1743"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1743"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jim-zimmerman.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1743"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}