簡體   English   中英

使用Exim中的管道進行郵件路由

[英]Mail Routing using pipe in Exim

我正在尋找向多個目的地發送電子郵件,即一個用戶指定的電子郵件地址,另一個用於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出現在日志中指定的確切位置。

在路由器部分,我編寫了自己的自定義路由器,將電子郵件發送到我想要的PHP腳本。 在傳輸部分寫了我自己的自定義傳輸,將確保使用curl傳遞到所需的腳本。 保持system_aliases在路由器配置部分,因為它是,但改變駕駛員acceptredirect .Wrote在我下面的配置/etc/exim.cnf文件:

############ROUTERS
runscript:
        driver = accept
        transport = run_script
        unseen
        no_expn
        no_verify
############TRANSPORT
run_script:
     debug_print = "T: run_script for $local_part@$domain"
     driver = pipe
     command = /home/bin/curl http://my.domain.com/mailTest.php --data-urlencode $original_local_part@$original_domain

mailTest.php是我的php腳本

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM