Jon*_*itt 6 php email command-line exim pipe
这可能是一个荒谬的问题,但它一直困扰着我.我有一个邮件转发器管道传输到PHP脚本,它收到完美,但我有以下错误邮寄给我立即:
A message that you sent could not be delivered to one or more of its recipients. This is a permanent error. The following address(es) failed:
pipe to |/home/[webroot]/public_html/external/mobile/email.php
generated by mobile@[mydomain]
The following text was generated during the delivery attempt:
X-Powered-By: PHP/5.2.13
Content-type: text/html
Run Code Online (Sandbox Code Playgroud)
正如您所看到的,Exim认为标题响应是我脚本的错误.该脚本可以完美地从php:// stdin接收电子邮件,但Exim快速回复错误.
加,
所以我的问题是:如何摆脱这两个标题?
谢谢,〜强尼
编辑,来源:
#!/usr/bin/php
<?php
$fd = fopen("php://stdin", "r");
$email = "";
while (!feof($fd)) {
$email .= fread($fd, 1024);
}
fclose($fd);
$dat = fopen(dirname(__FILE__).'/test.txt', 'w');
fwrite($dat, $email);
fclose($dat);
Run Code Online (Sandbox Code Playgroud)
use*_*291 16
看起来你正在运行php-cgi而你需要php-cli(只是"php").运行php -v以确保.如果是这种情况,请尝试"-q"选项.
归档时间: |
|
查看次数: |
4774 次 |
最近记录: |