?
Solved

DSPAM configuration for CENT OS 7

Posted on 2014-09-21
4
Medium Priority
?
537 Views
Last Modified: 2014-09-21
I can't find any links for the configuration ... only for other Linux distributions. Can you please help?
0
Comment
Question by:Starquest321
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 12

Assisted Solution

by:Ganesh Kumar A
Ganesh Kumar A earned 2000 total points
ID: 40335158
0
 

Author Comment

by:Starquest321
ID: 40335159
But I need Cent OS... not ubnutu
0
 
LVL 12

Assisted Solution

by:Ganesh Kumar A
Ganesh Kumar A earned 2000 total points
ID: 40335172
Create Dspam User

#adduser -d /usr/local/var/dspam -s /sbin/nologin dspam

Download and Installing Dspam

Login as root
#cd /root
#wget http://repository.wowtutorial.org/dspam-3.9.0-BETA1.tar.gz
#tar -zxvf dspam-3.9.0-BETA1.tar.gz
#cd dspam-3.9.0-BETA1
#./configure --enable-daemon \
    --with-storage-driver=mysql_drv \
    --with-mysql-includes=/usr/local/mysql/include/mysql \
    --with-mysql-libraries=/usr/local/mysql/lib/mysql \
    --enable-preferences-extension \
    --with-dspam-home-owner=dspam \
    --with-dspam-home-group=postdrop \
    --with-dspam-home=/usr/local/var/dspam \
    --enable-long-usernames \
    --with-dspam-group=postdrop \
    --enable-mysql4-initialization \
    --enable-domain-scale \
    --enable-virtual-users \
    --enable-clamav \
    --enable-debug \
    --enable-verbose-debug
#make && make install

Setting Dspam MySQL DB

#cd /root/dspam-3.9.0-BETA1
#mysqladmin create dspam
#mysql dspam < ./src/tools.mysql_drv/mysql_objects-4.1.sql

Grant Dspam User to Dspam DB with Password

#mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 732 to server version: 5.1.37-log

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> grant all on dspam.* to dspam@localhost identified by 'password123';
Query OK, 0 rows affected (0.03 sec)

mysql> exit

We also need to add extra virtual user table SQL DB to Dspam DB

#mysql dspam < ./src/tools.mysql_drv/virtual_users.sql

Configure Dspam

Note : dspam.conf is in /usr/local/etc/

#pico /usr/local/etc/dspam.conf

Home /usr/local/var/dspam
StorageDriver /usr/local/lib/dspam/libmysql_drv.so
TrustedDeliveryAgent "/usr/bin/procmail"
DeliveryHost        127.0.0.1
DeliveryPort        10026
DeliveryIdent       localhost
DeliveryProto       SMTP
OnFail error
Trust root
Trust dspam
Trust postfix
Trust daemon
Debug *
TrainingMode teft
TestConditionalTraining on
Feature whitelist
Algorithm graham burton
Tokenizer chain
PValue bcr
WebStats on
Preference "signatureLocation=headers"  # 'message' or 'headers'
Preference "showFactors=on"
Preference "spamAction=tag"
Preference "spamSubject=[SPAM]"
AllowOverride trainingMode
AllowOverride spamAction spamSubject
AllowOverride statisticalSedation
AllowOverride enableBNR
AllowOverride enableWhitelist
AllowOverride signatureLocation
AllowOverride showFactors
AllowOverride optIn optOut
AllowOverride whitelistThreshold
MySQLServer             /tmp/mysql.sock
MySQLPort               3306
MySQLUser               dspam
MySQLPass               password123
MySQLDb                 dspam
MySQLCompress           true
MySQLVirtualTable          dspam_virtual_uids
MySQLVirtualUIDField       uid
MySQLVirtualUsernameField  username
MySQLUIDInSignature    on
HashRecMax              98317
HashAutoExtend          on
HashMaxExtents          0
HashExtentSize          49157
HashPctIncrease 10
HashMaxSeek             10
HashConnectionCache     10
PurgeSignatures 14          # Stale signatures
PurgeNeutral    90          # Tokens with neutralish probabilities
PurgeUnused     90          # Unused tokens
PurgeHapaxes    30          # Tokens with less than 5 hits (hapaxes)
PurgeHits1S     15          # Tokens with only 1 spam hit
PurgeHits1I     15          # Tokens with only 1 innocent hit
LocalMX 127.0.0.1
SystemLog on
UserLog   on
Opt out
ParseToHeaders on
ChangeModeOnParse on
ChangeUserOnParse full
ClamAVPort      3310
ClamAVHost      127.0.0.1
ClamAVResponse accept
ServerPID              /var/run/dspam.pid
ServerMode auto
ServerParameters        "--deliver=innocent, spam"
ServerIdent             "localhost.localdomain"
ServerDomainSocketPath  "/tmp/dspam.sock"
ProcessorURLContext on
ProcessorBias on
StripRcptDomain off

Create dspam-retrain file in /usr/local/bin

#pico /usr/local/bin/dspam-retrain
#! /usr/bin/perl

# Get arguments
$class  = $ARGV[0] || die; shift;
$sender = $ARGV[0] || die; shift;
$recip  = $ARGV[0] || die; shift;

if ($recip =~ /^(spam|ham)-(\w+)@/) {
    # username is part of the recipient
    $user = $2;
} elsif ($sender =~ /^(\w+)@/) {
    # username is in the sender
    $user = $1;
} else {
    print "Can't determine user\n";
    exit 75;                    # EX_TEMPFAIL
}

# Pull out DSPAM signatures and send them to the dspam program
while (<>) {
    if ((! $subj) && (/^Subject: /)) {
        $subj = $_;
    } elsif (/(!DSPAM:[a-f0-9]+!)/) {
        open(F, "|/usr/local/bin/dspam --source=error --class=$class --user $user");
        print F "$subj\n$1\n";
        close(F);
    } elsif (/(X-DSPAM-Signature: [a-f0-9]+)/) {
        open(F, "|/usr/local/bin/dspam --source=error --class=$class --user $user");
        print F "$subj\n$1\n";
        close(F);
    }
}

Change dspam-retrain permission

#chmod 755 /usr/local/bin/dspam-retrain
0
 
LVL 12

Accepted Solution

by:
Ganesh Kumar A earned 2000 total points
ID: 40335174
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Encryption for Business Encryption (https://en.wikipedia.org/wiki/Encryption) ensures the safety of our data when sending emails. In most cases, to read an encrypted email you must enter a secret key that will enable you to decrypt the email. T…
There are times when I have encountered the need to decompress a response from a PHP request. This is how it's done, but you must have control of the request and you can set the Accept-Encoding header.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question