Mailing List Archive

randomize spamscanning- and av-IPs?
Hi,

it is possible to add multiple IPs to the av_scanner- and the spamd_address-settings like this:
spamd_address = 10.10.10.10 783 : 11.11.11.11 783 : 12.12.12.12 783

It seems that the machines always try first 10.10.10.10, then 11.11.11.11 and then 12.12.12.12
I know that I can give priorities via 10.10.10.10 783 pri=10 for example.
But is there a way to randomize how the spam-servers are tried? I have one machine that has always a very high load and the other machines are a bit bored. I could configure another order for each of my mail-servers by hand, but if there would be built-in randomization it would make things easier.

Cheers,
Niels
Re: randomize spamscanning- and av-IPs? [ In reply to ]
Am 19.05.21 um 09:14 schrieb Niels Kobschätzki via Exim-users:


> But is there a way to randomize how the spam-servers are tried?

You could use a hostname and round robin DNS. That would distribute the
load in a random way.

spamd_address = spamscan.host.tld 783

$host spamscan.host.tld
10.10.10.10
11.11.11.11
12.12.12.12

--
## 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/
Re: randomize spamscanning- and av-IPs? [ In reply to ]
On 19 May 2021, at 9:46, Kai Bojens via Exim-users wrote:

> Am 19.05.21 um 09:14 schrieb Niels Kobschätzki via Exim-users:
>
>
>> But is there a way to randomize how the spam-servers are tried?
>
> You could use a hostname and round robin DNS. That would distribute
> the load in a random way.
>
> spamd_address = spamscan.host.tld 783
>
> $host spamscan.host.tld
> 10.10.10.10
> 11.11.11.11
> 12.12.12.12

Great idea - I thought about something like that but with a
loadbalancer. But this would be far easier.
Thanks.

Niels


--
## 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/
Re: randomize spamscanning- and av-IPs? [ In reply to ]
On 19.05.21 09:14, Niels Kobschätzki via Exim-users wrote:
> But is there a way to randomize how the spam-servers are tried? I have one machine that has always a very high load and the other machines are a bit bored. I could configure another order for each of my mail-servers by hand, but if there would be built-in randomization it would make things easier.

According to the documentation, random selection is supposedly what
should happen, here.

Exim should randomly select one of the non-failed servers within the
highest priority set (and fall back to the lower priority servers only
if all the higher priority servers have failed).

And at least with equal weights, the algorithm in the code should
actually do that.

Kind regards,

  Peter

--

Dr. Peter Wullinger
Christian-Albrechts-Universität zu Kiel
Rechenzentrum
Abteilung Kommunikations- und Informationsdienste
Ludewig-Meyn-Str. 4
D-24118 Kiel
Tel: +49-431-880-3582
Fax: +49-431-880-1523
http://www.rz.uni-kiel.de
Re: randomize spamscanning- and av-IPs? [ In reply to ]
On 19 May 2021, at 14:26, Peter Wullinger wrote:

> On 19.05.21 09:14, Niels Kobschätzki via Exim-users wrote:
>> But is there a way to randomize how the spam-servers are tried? I have one machine that has always a very high load and the other machines are a bit bored. I could configure another order for each of my mail-servers by hand, but if there would be built-in randomization it would make things easier.
>
> According to the documentation, random selection is supposedly what should happen, here.
>
> Exim should randomly select one of the non-failed servers within the highest priority set (and fall back to the lower priority servers only if all the higher priority servers have failed).
>
> And at least with equal weights, the algorithm in the code should actually do that.

Thanks. I just reread the documentation and found it now. Interesting because I have several machines for spam-scanning which are specd the same and one is constantly under higher load than the other and that is the host that is the first one in the list.

Best,

Niels
Re: randomize spamscanning- and av-IPs? [ In reply to ]
Niels Kobsch?tzki wrote:
> Interesting because I have several machines for spam-scanning which are
> specd the same and one is constantly under higher load than the other and
> that is the host that is the first one in the list.

This is probably bug 2694, which was fixed in February 2021:

https://bugs.exim.org/show_bug.cgi?id=2694

Regards,
Heiko

Heiko Schlichting Freie Universit?t Berlin
heiko.schlichting@fu-berlin.de Zentraleinrichtung f?r Datenverarbeitung
Telefon +49 30 838-54327 Fabeckstra?e 32
Telefax +49 30 838454327 14195 Berlin
Re: randomize spamscanning- and av-IPs? [ In reply to ]
On Wed, May 19, 2021 at 9:14 AM Niels Kobschätzki via Exim-users <
exim-users@exim.org> wrote:

> Hi,
>
> it is possible to add multiple IPs to the av_scanner- and the
> spamd_address-settings like this:
> spamd_address = 10.10.10.10 783 : 11.11.11.11 783 : 12.12.12.12 783
>
> It seems that the machines always try first 10.10.10.10, then 11.11.11.11
> and then 12.12.12.12
> I know that I can give priorities via 10.10.10.10 783 pri=10 for example.
> But is there a way to randomize how the spam-servers are tried? I have one
> machine that has always a very high load and the other machines are a bit
> bored. I could configure another order for each of my mail-servers by hand,
> but if there would be built-in randomization it would make things easier.
>


As mentioned by Peter, based on the docs and the weight= option, it should
be randomized but not sure if a weight has to be explicitly declared for
randomization to kick in.
Alternatively, spamd_address is expanded so you could stick the servers IPs
in a file and make use of ${randint:n} with a lookup. ${lookup
{${randint:3}} lsearch{/path/to/file}}

where the file contains:

0: 10.10.10.10 783
1: 11.11.11.11 783
etc.


--
.warren
--
## 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/