2013-05-15 2 views
0

나는 최신 저장소 (apt-get) 접미사가있는 우분투 12.10 상자가 있습니다. 내가 sendmail 명령 줄에서 이메일을 보낼 때 :PHP + postfix : 메일러 데몬에 복사 된 모든 메일

sendmail -r [email protected] -f [email protected] -t [email protected] 

이메일은 [email protected] 만 보내 (이 좋다)한다. 그러나

, 내가 PHP와이 기능을 사용하는 경우 :

function mymail($to, $subject, $message, $frommail = "[email protected]", $fromname = "From Me") { 
    $subject = "=?utf-8?B?" . base64_encode($subject) . "?="; 
    $from = $fromname . " <" . $frommail . ">"; 
    $headers = "From: " . $from . " \r\n"; 
    $headers .= "MIME-Version: 1.0\r\n"; 
    $headers .= "Content-type: text/html; charset=UTF-8\r\n"; 
    $headers .= "Content-Transfer-Encoding: base64\r\n\r\n"; 
    $message = base64_encode($message); 
    $param = "-r " . $frommail . " \r\n"; 
    // Optionally tried also 
    // $param = "-r " . $frommail . " -f " . $frommail . " \r\n"; 
    mail($to, $subject, $message, $headers, $param); 
} 

다음 [email protected] MAILER-DAEMON은 (내 aliases 루트로 설정하는) 이메일을 받는다.

mail 명령 인 mailutils에 의해 판독 된 MAILER-DAEMON 이메일 : base64로 이메일 다음

Return-Path: <[email protected]> 
Delivered-To: [email protected] 
Received: by localhost (Postfix, from userid 33) 
    id 5663254EB; Wed, 15 May 2013 16:57:52 +0700 (ICT) 
To: [email protected] 
Subject: Test 
X-PHP-Originating-Script: 1000:mail_func.php 
From: FromMe <[email protected]> 
MIME-Version: 1.0 
Content-type: text/html; charset=UTF-8 
Content-Transfer-Encoding: base64 
Message-Id: <[email protected]> 
Date: Wed, 15 May 2013 16:57:52 +0700 (ICT) 

. PHP로 이메일을 보낼 때 MAILER-DAEMON이 사본을받지 못하게하려면 어떻게합니까?

답변

0

잘 모르겠습니다.이 질문을 삭제하거나 나중에 도움을 받아야합니다. 방금 이유를 찾았습니다.

$param = "-r " . $frommail . " \r\n"; 
: 여분의 매개 변수에, 나는

$param = "-f" . $frommail; 

대신 잘못의 ."\r\n"없이 사용해야합니다