SPF perl error solved

Discussion in 'Installation/Configuration' started by MaxT, Mar 26, 2016.

  1. MaxT

    MaxT Member

    I had this SPF error:

    tail -f /var/log/mail.log
    Code:
    postfix/smtpd[21258]:warning: command /usr/sbin/postfix-policyd-spf-perl exit status 13
    postfix/smtpd[21238]: warning: premature end-of-input on private/policy-spf while reading input attribute name
    
    the perl script inside /etc/postfix/master.cf doesn't work. Only the Python script:
    Code:
    policy-spf  unix  -       n       n       -       -       spawn
         user=nobody argv=/usr/bin/policyd-spf
    so need to install with apt-get install postfix-policyd-spf-python

    ** edit: the cause was inside /etc/resolv.conf. Please, go to message #3 of this thread

    hope it can be useful,
     
    Last edited: Mar 30, 2016
  2. Jesse Norell

    Jesse Norell Active Member

    The perl version does work (in my experience a little better than the python version), you have a problem on your particular server's installation. Stick with python if you're happy with it, but if you wish to troubleshoot the perl one, that can certainly be done. (hint: start with running/testing it from the command line using the example in the man page, check for other errors in mail.log, and verify or post your master.cf entry here)
     
  3. MaxT

    MaxT Member

    yes, you are right.

    At first I thought it was solved with the python alternative but the problem with the SPF error reappeared.

    Finally, the cause of the SPF error "warning: premature end-of-input on private/policy-spf while reading input attribute name" was the absence of "nameserver 127.0.0.1" inside /etc/resolv.conf , and also I have included this syntax inside /etc/postfix/master.cf:

    Code:
    policy-spf  unix  -  n  n  -  -  spawn
    user=nobody argv=/usr/bin/policyd-spf argv=/etc/postfix-policyd-spf-python/policyd-spf.conf
    
    However, I'm checking now with perl and it works too. So the real cause was in the /etc/resolv.conf. Probably the lack of local resolution causes the error.

    I had a little nightmare of several hours with this error. Internet is plenty of questions about that error without a clear answer. Now Postfix is working without any issue.

    I edit my first message, sorry for that!
     
    Last edited: Mar 30, 2016
    Jesse Norell likes this.
  4. Jesse Norell

    Jesse Norell Active Member

    Glad you found the problem there. A little note, the syntax on your master.cf entry is a bit off, you shouldn't have 2 argv= in there, more like:
    Code:
    policy-spf  unix  -  n  n  -  0  spawn
    user=nobody argv=/usr/bin/policyd-spf /etc/postfix-policyd-spf-python/policyd-spf.conf
    
     
    MaxT likes this.
  5. MaxT

    MaxT Member

    ok, thanks. Although I have followed your recommendation, and now I have the perl script :)
     

Share This Page