Re: [exim] Routing email to different smarthosts accordin to…

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Mike Brudenell
Data:  
Para: exim-users@exim.org
Assunto: Re: [exim] Routing email to different smarthosts accordin to a "percentage"
Hi, Diego -

I'm assuming you're using a *manualroute* router to select the smarthost to
send your outgoing message to?

I so and you are happy with a fairly even spread between the onward
smarthosts then the simplest solution might be to just add *hosts_randomize*
to your router on smarthost0 — something like this:

hosts_randomize = true

route_data = smarthost1 : smarthost2


As it explains in the *Specification*, this randomises the list of target
hosts each time the list is used. (You can also split this into groups
which are randomised within each group but not between if you have fallback
hosts only used when the primaries aren't available.)

If you instead want an uneven spread of load over the backend servers — you
mentioned a 90-10 split — then you can almost certainly do what you want
using *route_data*. The value of this is expanded so you can construct an
*if* expression that uses *randint* to generate a random number and, if
this is less than a threshold select one backend smarthost else the other.

For example, something like this (untested, and possibly syntactically
invalid! :-) …

route_data = ${if <= {${randint:100}} {10} \
                  {smarthost1} \
                  {smarthost2}}



Cheers,
Mike B-)

On 1 December 2017 at 17:46, Diego Bellini <Diego.Bellini@???>
wrote:

> Hi all,
> I have been using exim for a long time but it is my first time that I am
> posting here
>
> I am writing to ask for any suggestion in relation to this
>
> Let say I have 3 smarthosts: smarthost0, smarthost1, smarthost2
>
> Smarthost0 receives all the emails and then routes, let say, the 10
> percent of the emails via smarthost1 and the 90 percent via smarthost2
>
> There is a way to do this with exim?
>
> I would like to implement something like this as a way to warm up/or keep
> warm an IP
>
> Anyone's got an idea?
>
> Cheers,
> Diego
> --
> ## List details at https://lists.exim.org/mailman/listinfo/exim-users
> ## Exim details at http://www.exim.org/
> ## Please use the Wiki with this list - http://wiki.exim.org/
>




--
Systems Administrator & Change Manager
IT Services, University of York, Heslington, York YO10 5DD, UK
Tel: +44-(0)1904-323811

Web: www.york.ac.uk/it-services
Disclaimer: www.york.ac.uk/docs/disclaimer/email.htm