SquidGuard is a URL redirector used to use blacklists with the proxysoftware Squid. There are two big advantages to squidguard: it is fast and it is free.
Revision of DSPAM from Tue, 07/31/2012 - 16:31
Revisions allow you to track differences between multiple versions of your content, and revert back to older versions.
Prerequisites
- MySQL with InnoDB
- Apache webserver, compiled with:
./configure \
--enable-so \
--enable-ssl \
--enable-rewrite \
--enable-suexec \
--with-suexec-docroot=/var/websitesBefore you compile, edit
support/suexec.h
and change the AP_HTTPD_USER from the default "www" to the "nobody" that our Apache install instructions use:#define AP_HTTPD_USER "nobody"
#define AP_UID_MIN 99
#define AP_GID_MIN 99
Installation
cd /extra/src
wget http://cdnetworks-us-2.dl.sourceforge.net/project/dspam/dspam/dspam-3.10.2/dspam-3.10.2.tar.gz
tar zxf dspam-3.10.2.tar.gz
cd dspam-3.10.2
Configure it:
export LD_LIBRARY_PATH=/usr/local/mysql/lib/mysql:${LD_LIBRARY_PATH}
./configure \
--enable-daemon \
--enable-debug \
--enable-domain-scale \
--enable-long-usernames \
--with-dspam-home=/var/dspam \
--with-dspam-home-owner=simscan \
--with-dspam-home-group=simscan \
--with-dspam-owner=simscan \
--with-dspam-group=simscan \
--with-storage-driver=mysql_drv \
--with-mysql-libraries=/usr/local/mysql/lib/mysql \
--with-mysql-includes=/usr/local/mysql/include/mysql \
--enable-preferences-extension \
--enable-virtual-users \
Build and install the binaries:
make && make install
Set up MySQL database and tables:
cd src/tools.mysql_drv
/usr/local/mysql/bin/mysqladmin -u root -p create dspamdb
cat mysql_objects-speed.sql | /usr/local/mysql/bin/mysql -u root -p dspamdb
cat virtual_users.sql | /usr/local/mysql/bin/mysql -u root -p dspamdb
Log into MySQL and assign a password for simscan to us the dspam database:
/usr/local/mysql/bin/mysql -u root -p
grant all privileges on dspamdb.* to simscan@localhost identified by 'password';
flush privileges;
Of course, change "password" to something meaningful.Be aware that the user simscan has ALL privileges (including the ability to delete the database) unless you do something otherwise.
While in MySQL, make sure the dspam database tables use the InnoDB engine:
alter table dspam_preferences engine=innodb;
alter table dspam_signature_data engine=innodb;
alter table dspam_stats engine=innodb;
alter table dspam_token_data engine=innodb;
alter table dspam_virtual_uids engine=innodb;
Also, add indexes to a couple of the tables in case you want to optimize the purge script.
alter table dspam_token_data add index(spam_hits);
alter table dspam_token_data add index(innocent_hits);
alter table dspam_token_data add index(last_hit);
Configuration
Edit /usr/local/etc/dspam.conf
EnablePlusedDetail on
PlusedCharacter -
PlusedUserLowercase on
QuarantineMailbox -quarantine
Trust root
Trust dspam
Trust vpopmail
Trust simscan
Trust qmaild
Tokenizer osb
ImprobabilityDrive on
Preference "signatureLocation=headers"
MySQLServer /tmp/mysql.sock
MySQLUser simscan
MySQLPass p4ssw3rd
MySQLDb dspamdb
MySQLCompress true
MySQLReconnect true
MySQLConnectionCache 10
MySQLUIDInSignature on
LocalMX 127.0.0.1
ServerPID /var/service/dspam/var/dspam.pid
ServerMode dspam
ServerPass.ClientID "p4ssw3rd"
ServerDomainSocketPath /tmp/dspam.sock
ClientHost /tmp/dspam.sock
ClientIdent "p4ssw3rd@ClientID"
No longer necessary??
Create the file that allows DSPAM to access the database:
cd /var/dspam
Create the following file called mysql.data
, again changing "password":
/tmp/mysql.sock
simscan
password
dspamdb
Create the trusted.users file:
cd /var/dspam
echo "simscan" >trusted.users
If simscan hasn't been installed yet, add a user for it:
groupadd simscan
useradd -g simscan -s /bin/false -c "SimScan Content Filter" simscan
Change the permissions on the Dspam install so that the Simscan user can access it:
chown -R simscan:simscan /var/dspam
chown simscan:simscan /usr/local/etc/dspam.conf
chown simscan:simscan /usr/local/bin/dspam
Training Mode
Ending Spam: Bayesian Content Filtering and the Art of Statistical Language Classification - description of training modes
Daemontools startup
mkdir -m 1755 /var/service/dspam
cd /var/service/dspam
mkdir -m 0750 log var
wget http://qmail.jms1.net/dspam/service-dspam-run
mv service-dspam-run run
wget http://qmail.jms1.net/dspam/service-dspam-log-run
mv service-dspam-log-run log/run
chmod 0750 run log/run
chown simscan:simscan log var
chown root:simscan run log/run
NOTES
None of that stuff worked the latest time I did this. Had to add Trust simscan
and Trust qmaild
to /usr/local/etc/dspam.conf
as well as putting the MySQL info in that conf file as well.
Additional References
http://hmonteiro.net/howtos:qmail:qmail_plus_dspam
http://www.wimble.info/articles/dspam-qmail-vpopmail.php
http://gentoo-wiki.com/Dspam_vpopmail
http://www.directadmin.com/forum/showthread.php?t=16015
http://mail.michscimfd.com/dspam/
http://switch.richard5.net/isp-in-a-box-v2/setting-up-dspam/training-dspam-with-scripts/
- Log in to post comments