【发布时间】:2015-11-16 18:32:27
【问题描述】:
我正在寻找将电子邮件发送到多个目的地,即一个发送到用户指定的电子邮件地址,另一个发送到 php 脚本。在网上冲浪时,我得出结论,我必须在路由器中使用管道并传输我的邮件代理的配置,即我的例子中的 Exim。我尝试但未能在我的 Exim 配置中嵌入管道传输。服务器导致管道传输失败。需要帮助来解决此问题。 我将 exim.cnf 文件修改为:
############ ROUTERS
system_aliases:
driver = accept
domains = **.**.**.**(my Domain)
transport = use_pipe
############ TRANSPORT
use_pipe:
debug_print = "Using Pipe Transport"
driver = pipe
command = /etc/script.php
return_path_add
delivery_date_add
envelope_to_add
return_output
其中 script.php 是我要发送文件的第二个目的地。 以下是日志:
3402 uid=3000 gid=3000 pid=3402
3402 auxiliary group list: 3000
3402 home=NULL current=/
3402 set_process_info: 3402 delivering 1ZTPOU-0000sn-JB to abc using use_pipe
3402 Using Pipe Transport
3402 use_pipe transport entered
3402 direct command:
3402 argv[0] = /etc/testScript.php
3402 direct command after expansion:
3402 argv[0] = /etc/testScript.php
3402 Writing message to pipe
3402 writing data block fd=10 size=44 timeout=3600
3402 writing data block fd=10 size=2048 timeout=3600
3402 writing data block fd=10 size=1 timeout=3600
3404 set_process_info: 3404 reading output from |/etc/testScript.php
3402 use_pipe transport yielded 2
3402 search_tidyup called
3399 use_pipe transport returned FAIL for abc@myDomain
3399 post-process abc@myDomain (2)
3399 LOG: MAIN
3399 ** abc@myDomain R=system_aliases T=use_pipe: Child process of use_pipe transport returned 127 (could mean unable to exec or command does not exist) from command: /etc/testScript.php
*testScript 出现在日志中指定的确切位置。
【问题讨论】:
-
能否在日志文件中包含准确的错误消息?
-
@AndrzejA.Filip 日志包括在内。看看吧。
-
1) 检查脚本文件的权限:
ls -l /etc/testScript.php。 uid 3000 的用户可以执行吗? 2) 检查脚本#!...第一行的有效性。 uid 3000 的用户可以执行程序吗? linux.die.net/man/1/php -
@AndrzejA.Filip 我已经检查过了。文件或用户所有权的权限似乎没有任何问题。
标签: php linux centos pipe exim