Re: [exim] rotate inbound mail to multiple local accounts

Etusivu
Poista viesti
Vastaa
Lähettäjä: Marc Sherman
Päiväys:  
Vastaanottaja: exim-users
Aihe: Re: [exim] rotate inbound mail to multiple local accounts
Paul Hayes wrote:
>
> Is there a built-in feature of exim that'll allow me to do this or am I
> best off routing the mail to an external perl script to handle it? I
> guess the script would keep a counter stored in a file so it knows where
> the next email will go.


There's no built in feature that I'm aware of. If you're ok with it
being random instead of round-robin, you can build something with a
redirect router that hashes the message id to pick one member of the list:

TARGETS=user1 : user2 : user3
TARGETCOUNT=3

redirect_to_one_target:
   driver = redirect
   local_parts = catchall
   domains = domain.com
   data = ${extract{${nhash_TARGETCOUNT:$message_exim_id}} \
          {:}{TARGETS}{$value}fail}


I was surprised that I couldn't figure out how to calculate TARGETCOUNT
with an expansion item on TARGETS -- does anyone know how to do this?

- Marc