You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Micah Anderson <mi...@riseup.net> on 2010/04/21 16:59:26 UTC

spamc randomization

I'm using the --randomize option to spamc, along with the -d switch that
has a hostname which resolves to multiple IP addresses. 

Does the --randomize get passed the full set of IPs that are resolved
from the -d hostname and then it randomizes those IPs? In otherwords,
you can have one host name (say 'spamd') which resolves to multiple IPs
and then passed to the --randomize to be picked from? That seems to be
how it is described, but I could be misinterpreting it.

The description of the --randomize option in the man page which says,
'the IP addresses returned for the hosts given by the -d switch', and
the -d switch says you can do this:

           If host resolves to multiple addresses, then spamc will
           fail-over to the other addresses, if the first one cannot be
           connected to.  It will first try all addresses of one host
           before it tries the next one in the list.  


I'm also a little unclear what the --randomize man section means when it
says, "it will try only three times though." Say the hostname 'spamd'
resolves to four IP addresses: 192.168.1.2, 192.168.1.3, 192.168.1.4,
192.168.1.5. After -d resolve that hostname into those IPs, they are
passed to the --randomize function, and one of those four is picked. The
first one doesn't respond, so then it tries another one, that fails, it
then tries a final one and then gives up (not trying all four)?

Did I read this right? I appreciate any second eyes on my interpretation
here. 

thanks,
micah






Re: spamc randomization

Posted by RW <rw...@googlemail.com>.
On Wed, 21 Apr 2010 10:59:26 -0400
Micah Anderson <mi...@riseup.net> wrote:

> 
> I'm using the --randomize option to spamc, along with the -d switch
> that has a hostname which resolves to multiple IP addresses. 
> 
> Does the --randomize get passed the full set of IPs that are resolved
> from the -d hostname and then it randomizes those IPs? 

yes
 
> I'm also a little unclear what the --randomize man section means when
> it says, "it will try only three times though ... The first one
> doesn't respond, so then it tries another one, that fails, it then
> tries a final one and then gives up (not trying all four)?

3 is the default for --connect_retries


FWIW the list isn't actually randomized, it's randomly rotated, which
seems an odd way to do it to me. If one of the hosts goes down, the
next on the list gets a double load.