Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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.

share|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

1 Answer 1

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);
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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