1

Topic: Problem with setting up SPF check (and a solution)

==== Required information ====
- iRedMail version: 0.8.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):  MySQL
- Linux/BSD distribution name and version: Ubuntu 12.04
- Related log if you're reporting an issue:
====

Hi, I followed this guide to setup SPF check for iRedMail: http://www.iredmail.org/wiki/index.php? … _SPF_check

After everything was set up I tried to send an email from an external mailserver to iRedMail, but it failed. I checked /var/log/mail.log and noticed the following errors:

warning: command /usr/bin/python exit status 2
warning: premature end-of-input on private/spfpolicy while reading input attribute name
warning: problem talking to server private/spfpolicy: Connection reset by peer

I spent some time googling around and found almost nothing related to my case, but somebody mentioned trying to run "/usr/bin/python /usr/bin/policyd-spf" manually from command line. That's when I found out that the file didn't exist. The guide mentioned above is for CentOS and in Ubuntu the path is a little different.

Solution: Edit /etc/postfix/master.cf and go to the end:

# SPF check
spfpolicy unix  -       n       n       -       -       spawn
    user=nobody argv=/usr/bin/python /usr/bin/policyd-spf

In here, change "/usr/bin/policyd-spf" to "/usr/local/bin/policyd-spf" and then reload postfix.

Just wanted to share this solution if somebody else has the same problem with an Ubuntu based server. Imo the error message in mail.log is not very clear at this point.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Problem with setting up SPF check (and a solution)

jarkkolinnanvirta wrote:

Hi, I followed this guide to setup SPF check for iRedMail: http://www.iredmail.org/wiki/index.php? … _SPF_check

Oh, this wiki tutorial was contributed by iRedMail user "Maxie_ro".
iRedMail implements SPF checking with Amavisd + SpamAssassin (with perl module perl-SPF-Query), so you don't need this tutorial at all, it's enabled by default.