duanqiang7631 2019-02-13 20:10
浏览 234

电子邮件管道工作但发送退回电子邮件

I'm working on a script that pipes email messages to a database. I have the script working, but it sends a bounce email too.

Here is the bounce message:

This message was created automatically by mail delivery software.

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/montanah/public_html/admin/getmail.php
    generated by test@domain.com

The following text was generated during the delivery attempt:

------ pipe to |/home/montanah/public_html/admin/getmail.php
       generated by test@domain.com ------

Here is the code I am using:

#!/usr/bin/php -q
<?php
error_reporting(0);
require("db.php");
$email_msg = ''; // the content of the email that is being piped
// open a handle to the email
$fh = fopen("php://stdin", "r");
// read through the email until the end
while (!feof($fh)){
    $email_msg .= fread($fh, 1024);
}
fclose($fh); 
MDB::insert("res_recieved_mail", array("time"=>time(), "body"=>$email_msg, "status"=>1)); 
exit(0);

I have tried all of the following: ending with exit(0);, not ending with exit. return null;, ending with ?> I've CHMODDED 0700, 0755, 0777 I have made sure there are no blank lines, in either my script, or db.php I've made sure my editor (notepad++) is using unix new lines not windows, and I am uploading as ASCII not binary.

Any ideas?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿
    • ¥100 关于使用MATLAB中copularnd函数的问题