Re: [Exim] Help: external command for condition

Pàgina inicial
Delete this message
Reply to this message
Autor: Philip Hazel
Data:  
A: Phil Pennock
CC: Exim Users
Assumpte: Re: [Exim] Help: external command for condition
On Mon, 19 Feb 2001, Phil Pennock wrote:

> We'd like to use an external command's exit status for triggering a
> director. Yes, we know about the potential overhead. :^(


Aarrgghh!!

In Exim 4 you might be able to do this using queryprogram (whose revised
spec I have not yet determined). Well, not this exactly, but maybe
enough to do what you want.

> Short of embedding Perl and using a perl function which does system(),
> is there a way of doing this?


No.

> Failing that: Philip, how much hassle would a
> ${command{pathname}{argv0}{argv1}...}
> expansion item be, please?


Lots, I suspect. Although I suppose it isn't much worse than ${perl,
come to think of it.

An easier spec would be

${command:text of command}

with the text being split up into args just like a pipe command. There
is no chance of this in Exim 3 now.

> On 2001-02-19 at 20:22 +0000, Dr Andrew C Aitchison gifted us with:
> > ${command{pathname}{{env0}{env1}...}{{argv0}{argv1}...}} ?
> > Or can anyone see a better way of controlling the environment ?
> >
> > I'm tempted to say "security", but I can't justify it.
>
> Exim already nukes most of the environment.


When it runs a sub-process, yes (see spec of "pipe" for example).

> Perhaps if the command is run under the uid of the invoker, if the
> invoker is not Exim's own UID or root?


You are talking about using this in a director. During delivery, the
invoker usually is exim or root (after message reception, or in a queue
run).

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.