Re: [exim] Abusing transport to execute SQL delete

Pàgina inicial
Delete this message
Reply to this message
Autor: W B Hacker
Data:  
A: exim-users
Assumpte: Re: [exim] Abusing transport to execute SQL delete
Jakob Hirsch wrote:

> Quoting Andrew Lewis:
>
>
>>I have a desire to execute mysql delete statements in my remote_smtp
>>transport :) which would be rather useful to me. I'm having problems
>>finding a suitable place to put this though. I was abusing
>
>
> Basically, any option that is expanded, but you should use harmless one,
> e.g.
>
> fine_transport:
> ...
> headers_add = ${lookup mysql {...} {}{}}
>
>
>>envelope_add_to, which worked fine, until I restarted Exim, at which
>>point it complained bitterly about this and died. :)
>
>
> Probably because it's spelled envelope_to_add. But you shouldn't use
> that one on the remote_smtp transport and you cannot even use it since
> it's not expanded.
>
>
>>Would like to see a facility for executing arbitrary SQL (such as
>>inserts and deletes) within the routers and transports.
>
>
> Yes, that would be really nice. And also for ACLs. Name could be
> "expand", "do" or something like that.
>


An abuse, no doubt, but 'condition' can "house" arbitrary SQL in
routers. Downside, at present, is a need for potentially very
many routers, not to mention close care in ordering them.

I tend to keep transports single-purpose, and put any branching
or conditional complexity in the calling router.

That leads to a config with a higher line-count, but UIAW, the
lower parsing load makes it faster and simpler to de-bug.

acl's are easier - the 'warn' verb + arbitrary SQL (or anything
else).

That said a do | doend, 'mark', 'test' or 'inspect' verb would
be nice all-around, at least as a 'warn' synonym, as I am not
fond of the implication of the 'warn' verb for all cases.

Bill