0

Advanced Email Forwarding Options

Noah Dolph 6 year бұрын updated by Rodger Cravens 5 year бұрын 3
It would be great if the options for email forwarding were expanded a bit. A bit cpanel style would be great, specify either forward to an address or pipe, and then give options for the path of the pipe and the bin file to call. IE

Pipe to -> /some/path/to/script.php
Application -> php54
Options -> -q

Or something of that nature?
Actually... I guess I need the ability to add aliases. I can't modify the exim config file though as Ajenti automatically sets it up? Currently adding the pipe to the forwarder spot in Ajenti does not complete the pipe.

Found this for setting up piping...

First, browse to your Exim directory:
cd /etc/exim

Then create a directory to store your virtual hosts:
mkdir vhosts

Navigate to that directory:
cd vhosts

Then create a text file for your domain:
nano your_domain.com

Type in (replace "*" with an e-mail address
if you only want to handle e-mail to a certain
e-mail address with your handler):
*: |php -q /home/phpshare/public_html/handler.php

Save the file and exit.

Next, edit the configuration file for Exim
nano /usr/exim/configure

Change the domain list line to:
domainlist local_domains = @:localhost:dsearch;/etc/exim/vhosts

Type the following above "system_aliases:":
vhost_aliases:
driver = redirect
allow_defer
allow_fail
domains = dsearch;/etc/exim/vhosts
data = ${expand:${lookup{$local_part}lsearch*@{/etc/exim/vhosts/$domain}}}
retry_use_local_part
pipe_transport = address_pipe
file_transport = address_file
no_more

In addition, add or change "address_pipe:" to:
address_pipe:
driver = pipe
#pipe_as_creator

Save the configuration file and exit.

Then restart Exim / Sendmail:
/etc/init.d/exim restart
/etc/init.d/sendmail restart
What was the final solution? I am assuming that the forwarding solution worked? I am getting ready to test that exact thing - so it was of interest to see what your solution was.