dポイントプレゼントキャンペーン実施中!

自分で解決できなかったので、申し訳ないですが他力本願させていただきます。

空メール登録のシステムを作っています。
スクリプト以前に、メールを送ると
「Fw:Returned mail: see transcript for details」のタイトルで
以下のような文章でかえってきます。

rom: Mail Delivery Subsystem <MAILER-DAEMON@www.abc.com>
Date: Fri, 23 Jan 2009 19:15:27 +0900
To: <hoge@ezweb.ne.jp>
Subject: Returned mail: see transcript for details

The original message was received at Fri, 23 Jan 2009 19:15:27 +0900
from xxxxxxxxxx.ezweb.ne.jp [11.111.11.123]

----- The following addresses had permanent fatal errors -----
"|php /var/www/hoge-html/hogehoge/empty_mail.php"
(reason: Service unavailable)
(expanded from: <hohogege@hoge.jp>)

----- Transcript of session follows -----
smrsh: "empty_mail.php" not available for sendmail programs (stat failed)
554 5.0.0 Service unavailable

aliasesの設定には以下のようにしています。パスはあっています。
hohogege:"|php /var/www/hoge-html/hogehoge/empty_mail.phpp"

sendmail, postfixはインストールされています。

ちなみにスクリプトは以下のように書きました。
//PEAR::Mailライブラリ
require_once 'Mail.php';
//PEAR::Mail_mimeライブラリ
require_once '/usr/share/pear/Mail/mimeDecode.php';

//メールソースを読み込む
$source = file_get_contents("php://stdin");
if(!souce){
exit();
}

//メールを解析する。
$decoder = new Mail_mimeDecode($source);
$structure = $decoder->decode($params);

//送信元を取得する。
$form = $structure->headers['from'];
$form = mb_decode_mimeheader($from);
$form = mb_convert_encoding($form, mb_internal_encoding(), 'auto');
if(preg_match( '/<(.*?)>$/', $from, $match)){
$from = $match[1];
}
$from = trim($from);
$from = strtolower($from);

//送信データを設定する
$recipients = $from;
$new_from = 'hogehoge@abc.jp';
$subject = 'empty mail ok';
$body = 'http://www.hogehoge.jp';

//メールを送信する
$headers = array();

$headers['From']=$new_from;
$headers['To']=$recipients;
$headers['Subject']=$subject;
$headers['Sender']=$new_from;

$mail = Mail::factory('sendmail');
$result = $mail->send($recipients, $headers, $body);

A 回答 (1件)

・メールログを確認する。


・phpをフルパスに変更する。
・hohogegeを確認する。
    • good
    • 0
この回答へのお礼

ありがとうございます。
SMTPサーバーの設定がおかしかったもようです。

お礼日時:2009/01/31 11:26

お探しのQ&Aが見つからない時は、教えて!gooで質問しましょう!