You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Dave Stern <da...@umiacs.umd.edu> on 2006/04/03 17:49:36 UTC
running SA on multiple machines
I'm trying to get SA working by remote connections and don't see it
consistantly working.
Users kick off SA in their .procmailrc on our mail server which can't handle
a more recent version of SA so we only have v2.64 installed locally. (Don't
ask)
What I'd like to do is have a call in their .procmailrc something like this
:0fw: $HOME/spamassassin.lock
| /opt/spamassassin/bin/spamc -d spamcheck.fqdn -t 10
I have spamcheck.fqdn as a SRV record something like this:
spamcheck IN SRV 1 1 783 samachine.fqdn.
IN SRV 2 1 783 mailmachine.fqdn.
ie connect to port 783 on samachine and if it's not available, connect to
same port on mailmachine and timeout within 10 seconds if neither works
perhaps the timeout is too quick as I see no spamassassin headers in mail
going thru even tho procmail logfiles say it executed the spamc line.
I also tried variations on
| /opt/spamassassin/bin/spamc -d 127.0.0.1,10 -d 128.8.120.159,10 -t 10
Has anyone done spam checking to multiple machines with some type of
failover?
TIA
=-=-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
David Stern University of Maryland
Institute for Advanced Computer Studies
Re: running SA on multiple machines
Posted by David B Funk <db...@engineering.uiowa.edu>.
On Mon, 3 Apr 2006, Matt Kettler wrote:
[snip..]
> (who on earth still uses SRV records for anything?)
The 800 Lb Gorilla of Redmond. ;)
Most modern Kerberos clients will use them to find KDCs
if properly set up.
--
Dave Funk University of Iowa
<dbfunk (at) engineering.uiowa.edu> College of Engineering
319/335-5751 FAX: 319/384-0549 1256 Seamans Center
Sys_admin/Postmaster/cell_admin Iowa City, IA 52242-1527
#include <std_disclaimer.h>
Better is not better, 'standard' is better. B{
Re: running SA on multiple machines
Posted by Matt Kettler <mk...@evi-inc.com>.
Dave Stern wrote:
> On Mon, 3 Apr 2006, Matt Kettler wrote:
>>
>> (who on earth still uses SRV records for anything?)
>
>
> Actually, I'm told it's used a lot for windoze services (active dir?)
Ok, who that actually uses a real DNS server. :)
Re: running SA on multiple machines
Posted by "Daryl C. W. O'Shea" <sp...@dostech.ca>.
Dave Stern wrote:
> As to the format spamc -d 1.2.3.4,10 2.3.4.5,10
> That was from a google search. I believe that allows you to specify
> timeouts
> per host rather than a more universal "-t".
I'm not aware of that being valid.
> In any case, anything beyond a single host would either not fail to the
> second host (regardless of the syntax I used, ie I tried what you
> mentioned)
> or I would not see *any* spamassassin headers at all despite the procmail
> logs saying it ran spamc.
If you're using procmail, the most robust way to do fall back is to call
spamc once against your first spamd host, and then call spamc a second
time, if necessary, against the second spamd host.
Since spamc will only fallback if it fails to connect to something
listening on the target host, it won't fallback as you want in any other
event, like a timeout.
Part of your problem is expecting that all messages will be done in 10
seconds. If using any network tests, like Razor, DCC, etc, or even some
of the slower DNSBLs, many messages will take longer than 10 seconds.
If you're using bayes auto expiry (default on) even more will take more
than 10 seconds.
Daryl
Re: running SA on multiple machines
Posted by Dave Stern <da...@umiacs.umd.edu>.
On Mon, 3 Apr 2006, Matt Kettler wrote:
> Dave Stern wrote:
>> I'm trying to get SA working by remote connections and don't see it
>> consistantly working.
>>
>> Users kick off SA in their .procmailrc on our mail server which can't
>> handle
>> a more recent version of SA so we only have v2.64 installed locally.
>> (Don't
>> ask)
>>
>> What I'd like to do is have a call in their .procmailrc something like
>> this
>>
>> :0fw: $HOME/spamassassin.lock
>> | /opt/spamassassin/bin/spamc -d spamcheck.fqdn -t 10
>>
>> I have spamcheck.fqdn as a SRV record something like this:
>>
>> spamcheck IN SRV 1 1 783 samachine.fqdn.
>> IN SRV 2 1 783 mailmachine.fqdn.
>>
>> ie connect to port 783 on samachine and if it's not available, connect to
>> same port on mailmachine and timeout within 10 seconds if neither works
> Try this with multiple A records or CNAME records for the same name
> instead of using SRV records.
>
> (who on earth still uses SRV records for anything?)
Actually, I'm told it's used a lot for windoze services (active dir?)
> Spamc will automatically resolve down to A records and if it has
> multiple IPs, it try them in-order.
>
>> From the spamc manpage:
>
> **-d* /host[,host2]/*
> In TCP/IP mode, connect to spamd server on given host (default:
> localhost). Several hosts can be specified if separated by commas.
>
> 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 used SRV records rather than two ARECs or CNAMES because I didn't want
roundrobin behavior (ie I want ALL requests to always go to the first host
unless it's unavailable and only then failover to the second host. Thus
the equally weighted SRV rec.) My experience has been that even two Arecs
was doing roundrobin (even more interesting, the mailhost is running a caching
nameserver so I wouldn't expect it to roundrobin at all).
As to the format spamc -d 1.2.3.4,10 2.3.4.5,10
That was from a google search. I believe that allows you to specify timeouts
per host rather than a more universal "-t".
In any case, anything beyond a single host would either not fail to the
second host (regardless of the syntax I used, ie I tried what you mentioned)
or I would not see *any* spamassassin headers at all despite the procmail
logs saying it ran spamc.
>>
>> perhaps the timeout is too quick as I see no spamassassin headers in mail
>> going thru even tho procmail logfiles say it executed the spamc line.
>> I also tried variations on
>>
>> | /opt/spamassassin/bin/spamc -d 127.0.0.1,10 -d 128.8.120.159,10 -t 10
>
> Erm.. what's the ,10 for in those -d fields? The normal format would be:
>
> -d 127.0.0.1,128.8.120.159
>
> (This also should do what you want)
>
>>
>> Has anyone done spam checking to multiple machines with some type of
>> failover?
> Many have, and the docs even say how. Many folks use this same and add
> on the -H switch, which causes spamc to randomize what host it connects
> to from the list, often used for crude but effective load balancing.
>
> http://spamassassin.apache.org/full/3.1.x/dist/doc/spamc.html
>
=-=-=-=-=-=-=-=-=-=- generated by /dev/dave -=-=-=-=-=-=-=-=-=-=-=-=
David Stern University of Maryland
Institute for Advanced Computer Studies
Re: running SA on multiple machines
Posted by Matt Kettler <mk...@comcast.net>.
Dave Stern wrote:
> I'm trying to get SA working by remote connections and don't see it
> consistantly working.
>
> Users kick off SA in their .procmailrc on our mail server which can't
> handle
> a more recent version of SA so we only have v2.64 installed locally.
> (Don't
> ask)
>
> What I'd like to do is have a call in their .procmailrc something like
> this
>
> :0fw: $HOME/spamassassin.lock
> | /opt/spamassassin/bin/spamc -d spamcheck.fqdn -t 10
>
> I have spamcheck.fqdn as a SRV record something like this:
>
> spamcheck IN SRV 1 1 783 samachine.fqdn.
> IN SRV 2 1 783 mailmachine.fqdn.
>
> ie connect to port 783 on samachine and if it's not available, connect to
> same port on mailmachine and timeout within 10 seconds if neither works
Try this with multiple A records or CNAME records for the same name
instead of using SRV records.
(who on earth still uses SRV records for anything?)
Spamc will automatically resolve down to A records and if it has
multiple IPs, it try them in-order.
>From the spamc manpage:
**-d* /host[,host2]/*
In TCP/IP mode, connect to spamd server on given host (default:
localhost). Several hosts can be specified if separated by commas.
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.
>
> perhaps the timeout is too quick as I see no spamassassin headers in mail
> going thru even tho procmail logfiles say it executed the spamc line.
> I also tried variations on
>
> | /opt/spamassassin/bin/spamc -d 127.0.0.1,10 -d 128.8.120.159,10 -t 10
Erm.. what's the ,10 for in those -d fields? The normal format would be:
-d 127.0.0.1,128.8.120.159
(This also should do what you want)
>
> Has anyone done spam checking to multiple machines with some type of
> failover?
Many have, and the docs even say how. Many folks use this same and add
on the -H switch, which causes spamc to randomize what host it connects
to from the list, often used for crude but effective load balancing.
http://spamassassin.apache.org/full/3.1.x/dist/doc/spamc.html