<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>alexalmazan.com: Postfix SPF</title>
    <link>http://alexalmazan.com/articles/2008/07/30/postfix-spf</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>atypical typo tech rhelish</description>
    <item>
      <title>Postfix SPF</title>
      <description>&lt;p&gt;This article is to ouline the specifics for implementing &lt;span class="caps"&gt;SPF&lt;/span&gt; policy framework for Postfix provided in Redhat Enterprise Linux (es4/es5).&lt;/p&gt;


	&lt;p&gt;1.) First install all the necessary perl modules via &lt;span class="caps"&gt;RPM&lt;/span&gt; that you will require:&lt;/p&gt;


	&lt;p&gt;http://dag.wieers.com/rpm/packages/perl-Net-Address-IPv4-Local/
http://dag.wieers.com/rpm/packages/perl-NetAddr-IP/
http://dag.wieers.com/rpm/packages/perl-Mail-SPF/&lt;/p&gt;


	&lt;p&gt;(additional RPMs may be required) 
I would recommend that you refrain from installing via &lt;span class="caps"&gt;CPAN&lt;/span&gt; as a mix of &lt;span class="caps"&gt;RPM&lt;/span&gt; installed and &lt;span class="caps"&gt;CPAN&lt;/span&gt; installed modules can lead to issues in the future.&lt;/p&gt;


2.) Obtain and install the &lt;span class="caps"&gt;SPF&lt;/span&gt; perl script
&lt;pre&gt;
cd /usr/src
wget http://www.openspf.org/blobs/postfix-policyd-spf-perl-2.001.tar.gz
tar xvfz postfix-policyd-spf-perl-2.001.tar.gz
cd postfix-policyd-spf-perl-2.001
cp postfix-policyd-spf-perl /usr/libexec/postfix/postfix-policyd-spf-perl
chomd o+x /usr/libexec/postfix/postfix-policyd-spf-perl
&lt;/pre&gt;

Ensure that you set the script to executable, or errors such as these are recieved
&lt;pre&gt;
warning: command /usr/bin/perl exit status 2
postfix/smtpd: warning: premature end-of-input on private/policy while reading input attribute name
&lt;/pre&gt;

3.)Next, edit the postfix configuration file &amp;#8217;/etc/postfix/master.cf&amp;#8217;  This line should be appended to the end of the configuration.
&lt;pre&gt;
policy  unix  -       n       n       -       -       spawn
        user=nobody argv=/usr/bin/perl /usr/lib/postfix/policyd-spf-perl
&lt;/pre&gt;

4.)Next open /etc/postfix/main.cf and find the directive &amp;#8220;smtpd_recipient_restrictions&amp;#8221; You should have reject_unauth_destination in that directive, and right after reject_unauth_destination add &amp;#8216;check_policy_service unix:private/policy&amp;#8217;
&lt;pre&gt;
smtpd_recipient_restrictions =permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,check_policy_service unix:private/policy
&lt;/pre&gt;
&lt;strong&gt;&lt;span style="color:red;"&gt;important&lt;/span&gt;&lt;/strong&gt; ensure that you specify &amp;#8220;check_policy_service&amp;#8221; &lt;strong&gt;&lt;span style="color:red;"&gt;&lt;span class="caps"&gt;AFTER&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt; &amp;#8220;reject_unauth_destination&amp;#8221; or else you will have an open relay!</description>
      <pubDate>Wed, 30 Jul 2008 08:18:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f56e00b0-381c-4b4c-91c8-9137577b8729</guid>
      <author>aalmazan@rackspace.com (alex almazan)</author>
      <link>http://alexalmazan.com/articles/2008/07/30/postfix-spf</link>
      <category>Mail Server Tips &amp; Tricks</category>
    </item>
  </channel>
</rss>
