Re: [exim] change recipient in transport_filter

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Derek Knapp
Dátum:  
Címzett: 'Exim-users'
Tárgy: Re: [exim] change recipient in transport_filter
Just in case anyone runs across this thread wondering how I got it to work.


This is my router
----------------------------------------------------------------------------
-----------------------------------------------------------
xxxxx_router:
driver = accept
transport = xxxxx
condition = ${if or {{eq {$received_protocol}{redirect}}{!match
{$local_part}{........\-....\-....\-....\-............}}} {no}{yes}}
----------------------------------------------------------------------------
-----------------------------------------------------------


And my transport
----------------------------------------------------------------------------
-----------------------------------------------------------
xxxxx:
driver = pipe
command = /home/derek/exim/redirect.pl
user = mail
use_bsmtp = true
batch_max = 100
----------------------------------------------------------------------------
-----------------------------------------------------------


And here is the perl script
----------------------------------------------------------------------------
-----------------------------------------------------------
#!/usr/bin/perl

open(LOG, ">>/home/derek/exim/log.log") || die "error opening log\n";
open(OUT, "|/usr/sbin/exim -oMr redirect -bS") || die "error opening exim
process\n";

while (<STDIN>)
{
    print OUT $_;
    print LOG $_;
}


close(LOG);
close(OUT);
----------------------------------------------------------------------------
-----------------------------------------------------------


I hope this helps someone.

Check out this link, I found it very helpful
http://books.google.com/books?id=foCRVaMeRMgC&pg=PA91&lpg=PA91&dq=perl+exim+
oMr+bS&source=bl&ots=wpteylOqQX&sig=f8XnTaI9FCrdCUkB9jUib-BBoJ4&hl=en&ei=nKF
KS86GF46vtgfR8MnkDQ&sa=X&oi=book_result&ct=result#v=onepage&q=perl%20exim%20
oMr%20bS&f=false



Derek



On 2010-01-10 11:19, Derek Knapp wrote:
> Is it possible to change the recipient in a transport_filter?
>
> When I save the stdin to a file, I see
>
>
> test data
> --------------------------------------------------
>
> So the recipient doesn't seem to be there to change
>
>
>
>
>
> What I am trying to do is make it so when a message to an email for
> guid@??? arrives, it looks the guid up in a database, gets the real
> email address, and adds the email back in to the queue, this email address


> may not be a local address...  any hints would be greatly appreciated. So
> far this is what I have...
>
>
> Should I be using driver = pipe instead, then adding the message back

using
> bsmtp (not really sure what that is, but I see it in the spam assassin
> config)
>
>
>
> Derek

>
> __________ Information from ESET NOD32 Antivirus, version of virus

signature
> database 4634 (20091124) __________
>
> The message was checked by ESET NOD32 Antivirus.
>
> http://www.eset.com

>
>
>



__________ Information from ESET NOD32 Antivirus, version of virus signature
database 4634 (20091124) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com