Autor: Bryn Jones Data: Dla: Lord Caramac the Clueless CC: exim-users@exim.org Temat: Re: [exim] Run a shell script from transport?
On 10 Dec 2010, at 13:33, Lord Caramac the Clueless <schwarzlicht@???> wrote:
> Am 04.12.10 21:46, schrieb Phil Pennock:
>> On 2010-12-03 at 17:16 +0100, Nils Altenbach wrote:
>>> I have very limited experience with configuring Exim. I'm using exim4 on
>>> Lenny with a MySQL user database, which is working fine, but I want
>>> exim4 to run a shell script every time the transport
>>> local_mysql_delivery delivers a mail, with the username of the user
>>> receiving the mail (local part of the email address) as argument for
>>> that script.
>> Look for "shadow_transport" (and "shadow_condition").
>>
> I had been thinking about using a shadow_transport, and $run in the
> shadow condition, but I'm not quite sure how to do that. I've been
> following a tutorial (how to setup Exim / Dovecot for virtual users with
> MySQL) so far, and it works fine... but I need Exim to run this script
> every time one of those virtual users receives a message. I still need
> to learn more about transports and routers.
Duplicate the router for the virtual users, change its name and transport (you need to write this to do what you want) and remove any side effects. Make sure the new router is just before the real router (routers are tried in order), add the "unseen" keyword.
This router and hence the specified transport will accept a copy of the message at the point it is tried (as you copied the acceptance conditions), but the original message will continue to the real virtual users router (because of the unseen keyword).
A good place to look at this in action is to look at the vacation router and transport.