[EXIM] transport filters and conditional rewriting

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Torsten Curdt
Dátum:  
Címzett: exim-users
Tárgy: [EXIM] transport filters and conditional rewriting

>> As conditional rewriting depending on the destination of
>> messages can't be done in an other way I thought about doing
>> this by transport filters...
>>
>> In the transport section I defined:
>> local_delivery:
>>   driver = appendfile,
>>   transport_filter = "echo LOCAL $host $host_address\
>>       $sender_address $pipe_addresses |/usr/bin/tee -a /tmp/log";
>>   file = /var/spool/mail/${local_part},


>Hrm.. One of two things. Your line beginning with LOCAL or SMTP is
>coming back and is violating RFC822.. Or perhaps because wherever echo
>is isn't in the PATH that is defined at the time this is called.. Its
>also possible exim isnt doing shell interpretation and your "|" pipes
>arent working...
>I would replace them with
>
>transport_filter="/usr/local/bin/log-transport SMTP $host\
>$host_address $sender_address $pipe_addresses"


I feel ashamed posting such a mistake!! Sure you are totally right!

>where log-transport looks something like the following:

(Here was your script)

I guess this one does it in a better -well- easier way...
--SNIP
#!/bin/sh
echo $1 >> /tmp/log        # my local/smtp info
/usr/bin/tee -a /tmp/log    # tee the message to log and output
exit 0
--SNAP


This is a sollution for my conditional header rewriting problem...
But it's not a very nice one!! I have to do the rewriting by myself!
My transport_filter might or might not rewrite the message depending
on the destination address!!

But wouldn`t it be nicer to do so in the normal rewriting rules ?
How about a variable containing the recipient of the message ?
So a rewriting rule might look like:

tcurdt@* ${if match{$recipent_domain}{my.local.dom}{$1}{my.extern.dom}}

Unfortunatly I belief it`s not possible at the normal rewriting
because it is not a rewriting per message - am I right ?
But such a feature would be nice! (Or have I just missed it in
the docs ?)

--
Torsten  Curdt    /email/ tcurdt@???             \
                 /http://www.gwdg.de/~tcurdt          \
                /Thanx to Linus for a hell of a system!\



--
*** Exim information can be found at http://www.exim.org/ ***