PHPList(バージョン2.10.17)は、次のいずれかの形式に一致するアドレスにメッセージを送信できません。
my..Name@domain.com
myName.@domain.com
.myName@domain.com
エラーメッセージはCould not instantiate mail function.
次のとおりです。問題のコードは次のとおりです。
function MailSend($header, $body) {
$to = "";
for($i = 0; $i < count($this->to); $i++)
{
if($i != 0) { $to .= ", "; }
$to .= $this->to[$i][0];
}
if ($this->Sender != "" && (bool) ini_get("safe_mode") === FALSE)
{
$old_from = ini_get("sendmail_from");
ini_set("sendmail_from", $this->Sender);
$params = sprintf("-oi -f %s", $this->Sender);
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body,
$header, $params);
}
else
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
if (isset($old_from))
ini_set("sendmail_from", $old_from);
if(!$rt)
{
$this->SetError($this->Lang("instantiate"));
return false;
}
return true;
}
選択したコードパスは次のとおりです。
else
$rt = @mail($to, $this->EncodeHeader($this->Subject), $body, $header);
テスト目的でPHPListを設定した自分のWebサーバーでは、このエラーを再現できませんでした。
残念ながら、この動作を示している唯一のシステムは本番システムです。それに加えて、私はそのシステム上のログファイルにアクセスできないので、何が悪いのか本当にわかりません。
私の推測では、$to
これを機能させるには何らかの「文字列エスケープ」が必要ですが、本番システムを改ざんすることには多少消極的です(ロギング出力を挿入する以外)。
誰かがこの種の問題の回避策を知っていますか?