Mandriva
Please note that this documentation is in progress. It will eventually be a full HOWTO on how to get DSPAM working in Mandrake Linux

Mail The Unix Way - DSpam

Summary:

  • What is DSpam?
  • Who should be reading this HOWTO?
  • Building DSpam (if you don't have the RPM)
  • Installation
Section index - KB index

What is DSpam?

DSpam ('de-spam') is an open source server-side spam filter designed to work with Unix-based email systems. See http://www.nuclearelephant.com/projects/dspam/ for more information.

Who should be reading this HOWTO?

DSpam is a server-side mail filtering program. This means that it requires a functioning email server on the machine that it will be filtering mail on, of course if you've read through the previous pages in this HOWTO you should already have that.

However if you don't know how or don't want to run a local mail server (although it doesn't need to be accessible to the outside world) or if you just want a quick, easy to setup GUI based anti-spam tool, or you are a begginer to Linux or even computers in general, then DSpam isn't for you at this stage. I would suggest that you have a look at either the Mozilla Mail and Newsgroups application (install the package mozilla-mail) or the excellent Mozilla Thunderbird (based on Mozilla Mail and Newsgroups) from http://www.mozilla.org/products/thunderbird/. Both of these (free) products provide automatic, easy to configure spam filtering.

Note that you don't need to have your email server publicly accessible to get DSpam working, you could firewall it off and use fetchmail to get your email from your ISP's server.

Building DSpam (if you don't have the RPM)

  1. ./configure ––prefix=/usr ––with-delivery-agent="/usr/bin/maildrop -d $u" ––with-storage-driver=mysql_drv ––enable-homedir-dotfiles ––with-mysql-includes=/usr/include/mysql/
  2. make && make install
#add the postfix user to the mail group

#create /var/dspam/trusted.users (root:root 644) add the following to that file (Replace myusername with your username): root postfix daemon myusername postdrop mail cgi nobody

#create root:root 644 /var/dspam/untrusted.mailer_args add the following to that file: /usr/bin/maildrop -d $u

#setup daily cron script for dspam clean Add the following into an executable file in /etc/cron.daily: #1.1 /bin/sh #clean up stale and old stuff from DSPAM's database exec /usr/bin/dspam_clean -s exec /usr/bin/dspam_clean -p

#Find the maildrop unix line in Postfix's /etc/postfix/master.cf and change it to: maildrop unix - n n - - pipe flags=DRhu user=mail:mail argv=/usr/bin/maildrop -d ${recipient}

#In /etc/postfix/main.cf add or change the line which begins with mailbox_command to be like so mailbox_command = /usr/bin/dspam ––mode=teft ––deliver=innocent,spam ––feature=chained,noise ––user $USER -d %u

  1. make /usr/bin/dspam world executable. AFAIK this is the only way to get it working with postfix. I'm unsure of the security implications of this, especially since its already suid, tread carefully with this setup on multi-user systems.
  2. MySQL Setup (Replace /home/tim/dspam-3.0.0 with whereever you unpacked the DSpam source. Note that the RPMs put this file in /usr/share/doc/dspam):
mysql -u root -p create database dspamdb; grant all privileges on dspamdb.* to dspam@localhost identified by 'dspam' with grant option; quit; mysqladmin -uroot -p flush-privileges mysql -Ddspamdb -uroot -p < /home/tim/dspam-3.0.0/tools.mysql_drv/mysql_objects.sql.speed.optimized

#Add the following to /etc/postfix/aliases

  1. Aliases for DSPAM so users can forward wrongly classified emails back
spam-tim: "|'/usr/bin/dspam' ––user tim ––class=spam ––source=error ––mode=teft" notspam-tim: "|/usr/bin/dspam ––user tim ––source=error ––class=innocent ––mode=teft"

#Run the commands (as root) newaliases postalias /etc/postfix/aliases service postfix restart

#Install maildrop urpmi maildrop (In Mandrake 10 and probably others its in the Contributions - see the Mandrake Club Download section if you can't find it)

Copyright Tim Edwards 2004. Licenced under the GNU Free Documentation Licence.

KB - Mail The Unix Way - DSpam
Version 1.5 last modified by tim555 on 31/08/2004 at 14:21

 


en

RSS

Creator: tim555 on 2004/07/11 09:42
(c) Mandriva 2007
18888888