為什麼我會遇到 SPF Softfail?

為什麼我會遇到 SPF Softfail?

我使用 postfix 在 LAMP 伺服器上安裝了 SPF。但由於某種原因,我收到此錯誤

Received-SPF: softfail (mta1070.mail.re4.yahoo.com: domain of transitioning [email protected] does not designate 1.1.1.1 as permitted sender)

我有兩個問題:

1)如何解決這個錯誤

2)我一直在查看我的設定檔試圖改變[電子郵件受保護][電子郵件受保護]因為 anotherurl.com 有正確的 SPF TXT 記錄。我該去哪裡改變這件事?我嘗試在 /etc/postfix/main.cf 下編輯 myhostname,但沒有執行任何操作。

答案1

由於您是透過 PHP 發送的,因此您需要正確設定標頭並使用郵件函數的最後一個參數。像下面這樣的東西會起作用

<?php
$fromemail='[email protected]';
$to="[email protected]";
$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);

相關內容