Re: [exim] Very Advanced Address Rewriting

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Steffen Heil
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [exim] Very Advanced Address Rewriting
Hi

> I guess that's poorly worded. I will try to improve it. It
> doesn't matter how many recipients are in the message you
> send. If you set max_rcpt to 1 on the smtp transport, the
> *outgoing* messages will be sent with only one recipient. In
> other words, it will split up the message for you automatically.


Okay, this makes a lot more sense. I assumed it to be for incoming smtp
messages.

However, I came up with this solution now:

verb_router:
driver = redirect
condition = ${if match {${lc:$sender_address $local_part@$domain}}
{\N^(.*)-recipient@(.*) (\d*)-(.*)@(.*)$\N} }
data = ${if match {${lc:$sender_address $local_part@$domain}}
{\N^(.*)-recipient@(.*) (\d*)-(.*)@(.*)$\N} {$4@$5} }
errors_to = ${if match {${lc:$sender_address $local_part@$domain}}
{\N^(.*)-recipient@(.*) (\d*)-(.*)@(.*)$\N} {$1-$3@$2} }

AFAIK, this shoud rewrite
sender-recipient@??? => 123-local@???
to
sender-123@??? => local@???

Allowing me to send multiple RCPTs with different "number-email" pairs...

Any reason this should not work?
(And any way to prevent using the same regexp 3 times? I tried with data =
$4@$5 only, but this gave me errors.)

Regards,
Steffen