Re: [exim] redirect driver + transport choice

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Marcin Gryszkalis
Data:  
Para: exim-users
Assunto: Re: [exim] redirect driver + transport choice
On Friday of May 22 2009, W B Hacker wrote:
> > mysql_sms:
> >     driver = redirect
> >     data = ${lookup mysql {SELECT sms FROM user WHERE
> >         username='${quote_mysql:$local_part}'
> >         AND domain='${quote_mysql:$domain}'}{$value}}
> >     headers_add = X-SMS-Gateway-Filter: Yes
> >       address_data = SMS
> >       unseen


> If it is mere presence or absence of the header, not the string it carries,
> try 'def' instead of 'eq' as in;
>
> quarantine:
>    driver = accept
>    transport = quarantine_delivery
>    condition  = "${if def:header_X-Junk:{1}{0}}"


good point, though using headers doesn't work in this case - docs say:

(in headers_add)

"Warning 2: If the unseen option is set on the router, all header additions
are deleted when the address is passed on to subsequent routers."

(in unseen)
"Warning: Header lines added to the address (or specified for removal) by this
router or by previous routers affect the “unseen” copy of the message only.
The clone that continues to be processed by further routers starts with no
added headers [...]
Unlike the handling of header modifications, any data that was set by the
address_data option in the current or previous routers is passed on to
subsequent routers."


I think it should work like this

0. message[destination] = x@domain1
1. message[header_X-SMS:] is not defined
2. we get to the mysql_sms router (this is redirect router)
3. data = ... returns y@domain2 - this causes creation of the clone:
    message2[destination] = x@domain1
   and sets up new destination for oryginal message
    message[destination] = y@domain2
4. headers_add applies to the clone only:
    message2[header_X-SMS:] = Yes
5. message (oryginal) is reinjected and starts checking routers again (because 
the router is redirect) but it's not possible to find out what happened 
before reinjection because added headers are wiped out
6. message2 (clone) is passed to subsequent routers (because of unseen), it 
doesn't matter if the header is set because it's not the copy we want to 
filter


Is this description right?


> You may be more predictably served with use of acl_m variables.
> Simply set up the selective steering parameters in acl's before entering
> the router/transport sets.


But in acl I wouldn't know if I want to filter a message or not. The only
place I know what's going on is the redirect+unseen router...

greetings
--
Marcin Gryszkalis, PGP 0x9F183FA3
jabber jid:mg@???, gg:2532994
http://the.fork.pl