Re: [Exim] piping to a script

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: John (TJ) Penton
Ημερομηνία:  
Προς: Steve Foster
Υ/ο: exim-users
Αντικείμενο: Re: [Exim] piping to a script
On Thu, 11 Apr 2002, Steve Foster wrote:

> Hi there,
>
>
> i am trying to set up exim to pipe emails through a script , while removing
> part of the To: address,
> e.g
>
> i am sending to mail-ticket+test@mailserver , i want exim to remove the
> mail-ticket+ section, and just pass "test" to a script as the first argument.
>
> i can get it to do this by having the relevant alias in /etc/mail/aliases
> but i also want to avoid multiple aliasfile entries.
>
> currently the following works:
>
> mail-ticket+test: "|/usr/local/bin/spool-ticket.pl test"
>
> is there a way for this to be completed, either with a default aliasfile
> entry that causes all messages matching to go through the pipe transport???


I suggest something like (Exim 4 config, can be adapted for exim 3):

Create a router like:

ticket_router:
    driver = accept
    local_part_prefix = mail-ticket+
        transport = ticket_transport


Then a transport like:

ticket_transport:
    driver = pipe
    command = /usr/local/bin/spool-ticket.pl $local_part


In particular, the local_part_prefix option means that the router only
accepts addresses with those local parts - and then it strips the local
part for you.

Can't be sure the above is 100% accurate, but I hope it provides you a
starting point.

John

--
"What a long time whoever lives here is answering this door." And he
knocked again.
"But Poo," said Piglet, "it's your own house!"