Exim Handset Routing in Exim

I was looking to send an e-mail message to several recipients ie One for the user-specified email address and the other for the PHP script. Surfing over the Internet, I came to the conclusion that I need to use the handset in the routers and transmit the configuration of my mail agent ie Exim in my case. I tried, but could not enable pipe transfer in my Exim configurations. The server results in an unsuccessful pipe transfer. Need help fixing this issue. I changed the exim.cnf file as:

############ 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 

where script.php is the second destination where I want to send the file. Here are the logs:

  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 is present at the exact location indicated in the logs.

+4
source share
1 answer

In the routers section, I wrote my own custom router that will send email to my desired php script. My own custom transport was written in the transport section, which will ensure the delivery of the desired script using curl. He kept the system_aliases section in the router configuration, as he changed the driver from accept to redirect . The following configurations were written in my /etc/exim.cnf file:

 ############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 was my PHP script

+2
source

All Articles