December 6, 2007

 Improving Spam detection using DCC for Spamassassin

The DCC or Distributed Checksum Clearinghouse is an anti-spam checksum network. This is an optional module for Spamassassin, that can further increase the effectiveness of filtering junk-email from user mailboxes.

When @Mail is configured as the mail-server DCC can be installed via Spamassassin to add another layer of Spam filtering. The DCC network, as of mid-2006, it involves millions of users, tens of thousands of clients and more than 250 servers collecting and counting checksums related to more than 300 million mail messages on week days.

To configure DCC support under Spamassassin follow the guide below:

Step1: Downloading and installing DCC

First download the DCC package:

# wget 'http://www.rhyolite.com/anti-spam/dcc/source/dcc.tar.Z'

Note: Visit the DCC homepage at: http://www.rhyolite.com/anti-spam/dcc/ for the latest version.

# tar xfvz dcc.tar.Z
# cd dcc-1.3.38 ; ./configure ; make install

This will install the complete DCC package on your system, based from the C source.

Step2: Testing the DCC network responds

The DCC framework uses UDP packets to contact the list of public DCC servers - http://www.rhyolite.com/anti-spam/dcc/#public-servers for details.

DCC traffic is like DNS traffic. Allow outgoing packets to distant UDP port 6277 and incoming packets from distant UDP port 6277. These ports must be open for the DCC module to function correctly.

For example, if running Linux iptables add the following rule to /etc/sysconfig/iptables

# DCC for Spamassassin UDP reply packets
-A RH-Firewall-1-INPUT -p udp -m udp --dport 1024:65535 --sport 6277 -j ACCEPT

Save the changes and restart iptables.

# service iptables restart

If running a dedicated firewall appliance or ipfw under BSD, configure incoming UDP packets on port 6277 to the @Mail server.

Next, check the DCC network is responding

# cdcc info

This should return at least some records as 100%, if so you have configured the firewall successfully. Otherwise check your firewall rules and try again.

Step3: Tweaking the Spamassassin configure file

The next step is to configure Spamassassin to recognize the new DCC library.

Edit /usr/local/atmail/spamassassin/etc/local.cf

Append:

loadplugin Mail::SpamAssassin::Plugin::DCC
dcc_path /usr/local/bin/dccproc

Check the pathname to your dccproc by using:

# whereis dccproc

Or

# locate dccproc

This is the binary Spamassassin uses to communicate to the DCC network.

Note: When using the @Mail Webadmin > Filters > Spam-settings the local.cf will be re-written, so this value will have to be reset ( DCC will be included by default in a future @Mail version )

Once complete, restart the @Mail services to recognize the new configuration:

# /etc/init.d/atmailserver restart

Or use this for Redhat/fedora

# service atmailserver restart

Step4: Test DCC is working via Spamassassin

First you can download a common spam message that will trigger DCC detection at:

# wget 'http://kb.atmail.com/attach/spam-mail.txt'

Next, test a message via Spamassassin in debug mode for the results

# /usr/local/atmail/spamassassin/bin/spamassassin -t -D < spam-mail.txt

This will print verbose debugging info while scanning the email via Spamassassin.

On a successful DCC installation you will see the following returned:

dbg: plugin: loading Mail::SpamAssassin::Plugin::DCC from @INC
dbg: dcc: network tests on, registering DCC

If the message is detected on the DCC network Spamassassin will return:

 1.4 DCC_CHECK              Listed in DCC (http://rhyolite.com/anti-spam/dcc/)

Once complete, DCC will further protect user mailboxes from Spam messages


Filed under: Anti-Spam — info @ 2:13 pm

3 Comments »

  1. Followed this to the T, does not work. Running @mail version 5.20. When I run cdcc info, it can communicated 100%. Double checked where dccproc was and double checked local.cf to make sure they matched and they do.

    Comment by Matt — January 21, 2008 @ 1:58 am
  2. This description work well on @mail PHP 5.1, does not work on prel v.4.61. please help

    Comment by Damian — October 16, 2008 @ 1:07 am
  3. Atmail v4.61 (will work with others too)

    DCC will fail because it couldn’t connect to the 127.0.0.1 DCC server. I run a high-traffic mail server, so I chose to use my own DCC server locally. This will fix the DCC error messages.

    Edit /var/dcc/dcc_conf, you must have a unique SRVR_ID set for your DCC server, and make sure the server is enabled:

    SRVR_ID=1000
    DCCIFD_ENABLE=on

    Now edit the /var/dcc/ids file, and find the “# server-IDs” line. Below this is where you’ll need to add a password for the “1000″ id:

    1000 somepass123

    Next, copy the DCC initscript to your /etc/init.d/ so you can run DCC as a service:

    cp /var/dcc/libexec/rcDCC /etc/init.d/DCC

    and start the DCC server:

    /etc/init.d/DCC restart

    Next, try the spamassassin test as described by Atmail:

    /usr/local/atmail/spamassassin/bin/spamassassin -t -D

    Comment by Ryan G — May 3, 2010 @ 6:46 pm

RSS feed for comments on this post. TrackBack URI

Leave a comment