You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Dhaval Patel <dh...@patel.sh> on 2006/09/14 23:34:35 UTC
spamassassin setup
I am looking to install and configure spamassassin on my debian sarge server with about
15 users. We have been getting lots of spam lately and spambayes is not cutting it. We
need to use the rbl_check feature with spambayes to reduce the spams getting to our inbox.
I have a few questions:
1. From reading the docs I think using spamd and spamc (not spamassassin) would be the
best. Is that what people in this group would recommend? Any reasons why not?
2. From the looks of it, it seems that I have to start the spamassassin service and the
spamd service? Is this correct? Whats the difference between them? This was not clear
from the documentation.
3. I did not clear explaination on how exactly the rbl_checks work. Can I specify which
rbl to use and not use? I also could not find any information on which connections to
allow on the firewall to allow these checks. Our server is not allowed to make any
outgoing connections, we limit ougoing connections to certain ip/ports.
4. Does anybody know of a howto which involves debian, postfix, maildrop, spamassassin
and courier?
Thanks,
Dhaval
Re: spamassassin setup
Posted by "John D. Hardin" <jh...@impsec.org>.
On Thu, 14 Sep 2006, Dhaval Patel wrote:
> I found the following which contains rules. http://bl.csma.biz/csma.cf
>
> From looking at these rules, it would seem that my server would
> query bl.csma.biz to see if the IP the email came from is on their
> list. Which means that I would have to allow that on my firewall.
> Does that seem right?
It queries those servers using DNS. If your current DNS setup is
working, you should not have to do anything special to enable the
DNS-based RBL checks, as regular DNS queries go all over the place to
resolve requests.
--
John Hardin KA7OHZ ICQ#15735746 http://www.impsec.org/~jhardin/
jhardin@impsec.org FALaholic #11174 pgpk -a jhardin@impsec.org
key: 0xB8732E79 - 2D8C 34F4 6411 F507 136C AF76 D822 E6E6 B873 2E79
-----------------------------------------------------------------------
What nuts do with guns is terrible, certainly. But what evil or crazy
people do with *anything* is not a valid argument for banning that
item. -- John C. Randolph <jc...@idiom.com>
-----------------------------------------------------------------------
3 days until The 219th anniversary of the signing of the U.S. Constitution
Re: spamassassin setup
Posted by Dhaval Patel <dh...@patel.sh>.
Theo Van Dinter <fe...@apache.org> said:
> On Thu, Sep 14, 2006 at 10:00:31PM -0000, Dhaval Patel wrote:
> > Is there any info on how to enable/disable/write my own rules?
>
> Yes. Enabling is simple, just have the rule in place. Disabling is simple,
> just set the score for the rule to 0. Writing your own is a little harder...
> If you do a "perldoc Mail::SpamAssassin::Conf" you'll see all the config
> options, which include rules. I don't know if there's a specific doc that
> talks about writing rules, but there's probably some pointers on the wiki,
> etc.
>
> Otherwise, looking through the default rules would be good. :)
I found the following which contains rules. http://bl.csma.biz/csma.cf
>From looking at these rules, it would seem that my server would query bl.csma.biz to see
if the IP the email came from is on their list. Which means that I would have to allow
that on my firewall. Does that seem right?
Thanks,
Dhaval
Re: spamassassin setup
Posted by Logan Shaw <ls...@emitinc.com>.
On Thu, 14 Sep 2006, Dhaval Patel wrote:
>> SpamAssassin comes with a whole bunch of rules by default.
>> The best thing is to look at those rules and see what they're
>> doing. There's probably real documentation somewhere, but
>> there is so much example code that you may not need it.
>
> I did not see much in the local.cf after a fresh installation. I went to
> http://www.yrex.com/spam/spamconfig.php to generate my config file.
SpamAssassin installs a whole bunch of rules files that it
references. It may depend on the system, but on my machine,
they're in /usr/share/spamassassin.
>>> So to see if an ip or hostname is in the RBL it would make a request to the RBL servers
>>> on port 53 just like DNS queries?
>>
>> It's not just like regular DNS queries. It *is* a regular DNS
>> query. It doesn't go against any extra, third-party servers.
>> I believe SpamAssassin uses its own resolver code, but it
>> looks at /etc/resolv.conf just like anything else and uses
>> the nameserver (nameservers?) it finds in there.
>
> Thanks for the clear up. But one more question about this. If it users my DNS servers,
> how does it query the RBL servers and give them the hostname or ip?
It encodes them as paths within the DNS namespace. This is
sort of a hack, but it works.
For example, suppose you decide to set up your own DNSBL,
and you decide you hate Google and Apple and you want to put
them on your blacklist. Maybe you own the domain dhaval.org
and you decide to call your DNSBL the "dpbl" (for Dhaval Patel
Black-List). To create this blacklist, you would simply create
two DNS entries[1]:
google.com.dpbl.dhaval.org. IN A 127.0.0.1
apple.com.dpbl.dhaval.org. IN A 127.0.0.1
Now, let's say I want to check whether google.com is on
your blacklist. I take the string "google.com" and I append
".dpbl.dhaval.org" onto it. Then I do a regular DNS lookup to
see if "google.com.dpbl.dhaval.org" exists. If I get a record
back, you've blacklisted them. If I get back a reply that says
it's a non-existent domain, you haven't. (The fact that the
address 127.0.0.1 is returned isn't really relevant, usually;
that's just there because a DNS "A" record has to include some
sort of address.) To do an IP-address-based blacklist instead
of (textual) domain-based one, you can use a similar mechanism.
If I want to know if 10.20.30.40 is on your blacklist, I just
look up 10.20.30.40.dpbl.dhaval.org.
>From your Linux machine's point of view and from the point
of view of the caching nameserver at your ISP, there isn't
any difference at all between this and a regular DNS lookup.
The DNS server that does the lookup has to chase IN NS records
from the root servers all the way down the hierarchy to know
which servers to consult, but it always has to do that, even
if you are looking up www.cs.berkeley.edu or something.
- Logan
[1] Well, actually more than two. You'd need the supporting
entries like SOA and NS entries for each level of the
DNS namespace. But we only care about two of them.
Re: spamassassin setup
Posted by Dhaval Patel <dh...@patel.sh>.
> SpamAssassin comes with a whole bunch of rules by default.
> The best thing is to look at those rules and see what they're
> doing. There's probably real documentation somewhere, but
> there is so much example code that you may not need it.
I did not see much in the local.cf after a fresh installation. I went to
http://www.yrex.com/spam/spamconfig.php to generate my config file.
>
> > So to see if an ip or hostname is in the RBL it would make a request to the RBL servers
> > on port 53 just like DNS queries?
>
> It's not just like regular DNS queries. It *is* a regular DNS
> query. It doesn't go against any extra, third-party servers.
> I believe SpamAssassin uses its own resolver code, but it
> looks at /etc/resolv.conf just like anything else and uses
> the nameserver (nameservers?) it finds in there.
Thanks for the clear up. But one more question about this. If it users my DNS servers,
how does it query the RBL servers and give them the hostname or ip?
>
> The corollary to this is that you will need to make sure your
> existing DNS server can handle the load. But if you have only
> 15 users, you should be OK on that. :-)
I already checked with my hosting provider and they said its OK.
Thanks,
Dhaval
Re: spamassassin setup
Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Sep 14, 2006 at 10:00:31PM -0000, Dhaval Patel wrote:
> Is there any info on how to enable/disable/write my own rules?
Yes. Enabling is simple, just have the rule in place. Disabling is simple,
just set the score for the rule to 0. Writing your own is a little harder...
If you do a "perldoc Mail::SpamAssassin::Conf" you'll see all the config
options, which include rules. I don't know if there's a specific doc that
talks about writing rules, but there's probably some pointers on the wiki,
etc.
Otherwise, looking through the default rules would be good. :)
> So to see if an ip or hostname is in the RBL it would make a request to the RBL servers
> on port 53 just like DNS queries?
>
> I have my firewall setup to only allow DNS queries to go out to my DNS servers. If
> spamassassin tries to query another DNS server, it will fail, thats why I need to know
> which servers I need to enable DNS access to.
SA (via Net::DNS) will use whatever DNS server you configure the machine to
use, so there's probably nothing special you'll have to do if you already
allow DNS traffic to your nameserver.
--
Randomly Selected Tagline:
My favorite mythical creature? The honest politician.
Re: spamassassin setup
Posted by Logan Shaw <ls...@emitinc.com>.
On Thu, 14 Sep 2006, Dhaval Patel wrote:
>>> 3. I did not clear explaination on how exactly the rbl_checks work. Can I specify
>>> which rbl to use and not use? I also could not find any information on which
>>> connections to allow on the firewall to allow these checks. Our server is not allowed
>>> to make any outgoing connections, we limit ougoing connections to certain ip/ports.
>> Hrm, that's going to be problematic for you. You can specify what rbls to
>> use by enabling/disabling/writing your own rules. RBLs (and URIBLs) run via
>> DNS.
> Is there any info on how to enable/disable/write my own rules?
SpamAssassin comes with a whole bunch of rules by default.
The best thing is to look at those rules and see what they're
doing. There's probably real documentation somewhere, but
there is so much example code that you may not need it.
> So to see if an ip or hostname is in the RBL it would make a request to the RBL servers
> on port 53 just like DNS queries?
It's not just like regular DNS queries. It *is* a regular DNS
query. It doesn't go against any extra, third-party servers.
I believe SpamAssassin uses its own resolver code, but it
looks at /etc/resolv.conf just like anything else and uses
the nameserver (nameservers?) it finds in there.
> I have my firewall setup to only allow DNS queries to go out to my DNS servers. If
> spamassassin tries to query another DNS server, it will fail,
That should be fine then. SpamAssassin relies on exactly
the same set of servers you use right now. The DNS-based
real-time blacklists are a part of the regular DNS namespace.
They are just a subtree of the main hierarchy. This means your
existing DNS server can query them and cache them and so on.
The corollary to this is that you will need to make sure your
existing DNS server can handle the load. But if you have only
15 users, you should be OK on that. :-)
- Logan
Re: spamassassin setup
Posted by Dhaval Patel <dh...@patel.sh>.
> > 3. I did not clear explaination on how exactly the rbl_checks work. Can I specify
> >which rbl to use and not use? I also could not find any information on which
> >connections to allow on the firewall to allow these checks. Our server is not allowed
> >to make any outgoing connections, we limit ougoing connections to certain ip/ports.
> Hrm, that's going to be problematic for you. You can specify what rbls to
> use by enabling/disabling/writing your own rules. RBLs (and URIBLs) run via
> DNS.
Is there any info on how to enable/disable/write my own rules?
So to see if an ip or hostname is in the RBL it would make a request to the RBL servers
on port 53 just like DNS queries?
I have my firewall setup to only allow DNS queries to go out to my DNS servers. If
spamassassin tries to query another DNS server, it will fail, thats why I need to know
which servers I need to enable DNS access to.
Thanks,
Dhaval
Re: spamassassin setup
Posted by Theo Van Dinter <fe...@apache.org>.
On Thu, Sep 14, 2006 at 09:34:35PM -0000, Dhaval Patel wrote:
> 1. From reading the docs I think using spamd and spamc (not spamassassin) would be the
> best. Is that what people in this group would recommend? Any reasons why not?
Generally speaking you want to use spamc/spamd instead of spamassassin if
you're going to be processing messages on-going, like from procmail or
something.
> 2. From the looks of it, it seems that I have to start the spamassassin service and the
> spamd service? Is this correct? Whats the difference between them? This was not clear
> from the documentation.
There's only "spamd". Sometimes the rc is called "spamassassin" and sometimes
it's called "spamd". It largely depends on your distro and such.
> 3. I did not clear explaination on how exactly the rbl_checks work. Can I specify which
> rbl to use and not use? I also could not find any information on which connections to
> allow on the firewall to allow these checks. Our server is not allowed to make any
> outgoing connections, we limit ougoing connections to certain ip/ports.
Hrm, that's going to be problematic for you. You can specify what rbls to
use by enabling/disabling/writing your own rules. RBLs (and URIBLs) run via
DNS.
--
Randomly Selected Tagline:
"the curls in your keyboard cord are losing electricity."
- Today's BOFH Excuse