Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/email/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何将(exim)电子邮件跳转到php文件_Php_Email_Swiftmailer_Centos7_Exim - Fatal编程技术网

如何将(exim)电子邮件跳转到php文件

如何将(exim)电子邮件跳转到php文件,php,email,swiftmailer,centos7,exim,Php,Email,Swiftmailer,Centos7,Exim,我目前正在Centos 7服务器上工作,该服务器使用exim与swiftmailer一起处理电子邮件。当一封电子邮件被退回时,“错误”将被发送到我的电子邮件地址。我希望能够将“错误”发送到脚本,而不是通过电子邮件接收反弹。如果我一直在寻找这样做的方法,但我也无法在网上找到答案 有没有办法做到这一点?如果是这样的话,怎么做呢?您必须编写一个路由器和一个传输 路由器应检测发送方发出的反弹消息,即。因此,您必须将下一个配置放在路由器部分的开头: begin routers: bounce_proces

我目前正在Centos 7服务器上工作,该服务器使用exim与swiftmailer一起处理电子邮件。当一封电子邮件被退回时,“错误”将被发送到我的电子邮件地址。我希望能够将“错误”发送到脚本,而不是通过电子邮件接收反弹。如果我一直在寻找这样做的方法,但我也无法在网上找到答案


有没有办法做到这一点?如果是这样的话,怎么做呢?

您必须编写一个路由器和一个传输

路由器应检测发送方发出的反弹消息,即
。因此,您必须将下一个配置放在
路由器
部分的开头:

begin routers:
bounce_processor:
  driver    = accept
  condition = ${if eq{$sender_address}{"<>"}}
  transport = bounce_script
  unseen
. . . . . 

在这里,消息通过管道传递到使用一些参数启动的可执行文件的
stdin
。仅此而已。

感谢您的回复,但结果是:预期响应代码为220,但得到了代码“”,并显示消息“您如何获得该响应?”?在哪里?这是我尝试发送电子邮件后从swiftmailer收到的响应。我通过添加:在“bounce_processor”中修复了错误,但它不运行Scriptoops!抱歉打错了!脚本应该由有效的
exim
用户执行-通常是
mailnull
。有关详细信息,请查看exim日志。
bounce_script:
  driver  = pipe
  command = /path/script -arg1 -arg2