I installed SPF on my LAMP server with postfix. But for some reason, I get this error

Received-SPF: softfail (mta1070.mail.re4.yahoo.com: domain of transitioning www-data@websiteurl.com does not designate 1.1.1.1 as permitted sender)

I have two questions:

1) how do I trouble shoot this error

2) I've been looking through my configuration files in an attempt to change www-data@websiteurl.com to www-data@anotherurl.com because anotherurl.com has the correct SPF TXT records. Where do i go to change this? I tried editing myhostname under /etc/postfix/main.cf, but it didn't do anything.

link|improve this question

The error is due to the wrong e-mail address showing up in the From: field, which it seems you have identified in #2. I don't know Postfix, but someone around here will. – Chris S Jun 7 '10 at 19:22
Perfect! I temporarily fixed the problem by changing the IP address A Record of websiteurl.com to the same as anotherurl.com. So now email servers can find the SPF TXT records. But I'll need a better solution, because websiteurl.com will be down until i remap the IP address back to original. – John Jun 7 '10 at 19:30
the www-data suggests that these are being sent via a script, if I'm correct what language? – Rwky Jun 7 '10 at 20:11
@obsidian - correct. I'm using PHP5 with Apache 2 on Ubuntu 8.04 – John Jun 7 '10 at 20:36
feedback

1 Answer

Since you're sending via PHP you need to set the headers properly and use the last parameter of the mail function. Something like the following will work

<?php
$fromemail='youremail@domain.com';
$to="na@na.com";
$subject="this is an email";
$headers = 'MIME-Version: 1.0' . "\r\n".'Content-type: text/html; charset=UTF-8'."\r\n".'From: '.$fromemail."\r\n" .
$headers .= "Reply-To: ".$fromemail."\r\n";
$headers .= "Return-Path: ".$fromemail."\r\n";
$extra='-r '.$fromemail;
mail($to,$subject,$message,$headers,$extra);
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.