==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): Mysql
- Linux/BSD distribution name and version: Debian 7.4
- Related log if you're reporting an issue: none
====
I All, First off all thanks for iredmail, it's great and quite easy to use and manage.
But, As non spam lover I want to have DSPAM as complement for spam filtering.
So Here Is a HowTo that worked for me, with debian and mysql backend.
Compilation
aptitude install libmysqlclient-dev
cd ~
wget <DSPAM TAR.GZ ADDRESS>
tar xvzf dspam-3.10.2.tar.gz
cd dspam-3.10.2
./configure --prefix=/usr --disable-dependency-tracking --includedir=/usr/include --with-logdir=/var/log/dspam/ --with-dspam-home=/var/amavis/dspam --sysconfdir=/etc/ --enable-domain-scale --without-delivery-agent --with-mysql-includes=/usr/include/mysql --with-storage-driver=mysql_drv --enable-virtual-users --enable-preferences-extension --enable-daemon --enable-debug
make
make install
Alternatives apt-get install dspam
Base de données
mysql -u root -p
create database dspam;
GRANT SELECT, INSERT, UPDATE, DELETE ON dspam.* TO 'dspam'@'localhost' IDENTIFIED BY '******';
FLUSH PRIVILEGES;
quit
cd ~
wget /spip/doc/Procmail/dspam/mysql_objects-4.1.sql
mysql -u root -p dspam < mysql_objects-4.1.sql
Configuration
cd /etc/
mv dspam.conf dspam.conf-orig
wget /spip/doc/Procmail/dspam.conf
sed -i 's/\/var\/amavis\/dspam/\/var\/lib\/amavis\/dspam/g' dspam.conf
sed -i 's/\*\*\*\*\*\*/toto/g' dspam.conf
cd /etc/init.d/
wget /spip/doc/Procmail/init.d/dspam
chmod +x dspam
insserv -v /etc/init.d/dspam
Permissions
chown amavis: /usr/bin/dspam*
chown amavis: /etc/dspam.conf
chmod 750 /usr/bin/dspam*
chmod 640 /etc/dspam.conf
chown amavis: /var/log/dspam
chown -R amavis: /var/lib/amavis/dspam
AmAviS
Ajouter ceci à /etc/amavis/conf.d/50-user
$sa_tag_level_deflt = 10
$dspam = 'dspam';
@spam_scanners = (
['SpamAssassin', 'Amavis::SpamControl::SpamAssassin'],
['DSPAM', 'Amavis::SpamControl::ExtProg', $dspam,
[ qw(--client --stdout --process --deliver=innocent,spam
--user), $daemon_user ],
score_factor => 0.39,
],
);
Parametre DSPAM
dspam_admin change preference default "dailyQuarantineSummary" "off"
dspam_admin change preference default "enableBNR" "on"
dspam_admin change preference default "enableWhitelist" "on"
dspam_admin change preference default "fallbackDomain" "off"
dspam_admin change preference default "ignoreGroups" "off"
dspam_admin change preference default "ignoreRBLLookups" "off"
dspam_admin change preference default "makeCorpus" "off"
dspam_admin change preference default "optIn" "off"
dspam_admin change preference default "optOut" "on"
dspam_admin change preference default "optOutClamAV" "on"
dspam_admin change preference default "processorBias" "on"
dspam_admin change preference default "showFactors" "off"
dspam_admin change preference default "signatureLocation" "headers"
dspam_admin change preference default "spamAction" "tag"
dspam_admin change preference default "spamSubject" "[SPAM]"
dspam_admin change preference default "statisticalSedation" "6"
dspam_admin change preference default "storeFragments" "off"
dspam_admin change preference default "tagNonspam" "off"
dspam_admin change preference default "tagSpam" "off"
dspam_admin change preference default "trainingMode" "TOE"
dspam_admin change preference default "trainPristine" "off"
dspam_admin change preference default "whitelistThreshold" "10"
Id off user can be found via : id -u username
mysql -u root -p dspam
INSERT INTO `dspam_virtual_uids` (`uid`, `username`) VALUES
(108, 'amavis');
Activating Vuser
dspam_admin change preference default "optIn" "on"
dspam_admin change preference default "optOut" "off"
Demarrage
/etc/init.d/dspam start
We check : ps aux | grep dspam
Amavis restart
/etc/init.d/amavis restart
We check
cat /var/log/mail.info | grep DSPAM
Maintenance
cd /var/lib/amavis/
wget /spip/doc/Procmail/dspam-purge-4.1.sql
wget /spip/doc/Procmail/caremail/cron/dspam-purgesql.sh
sed -i 's/\*\*\*\*\*\*/toto/g' dspam-purgesql.sh
sources
/spip/spip.php?article12
Because off Link limitation in post, please replace all missing domains by w.w.w.starbridge.o.r.g
You need to train DSPAM for your needs, and as simple way to do it, I want to make 2 folder in all users mailboxes.
I thought it was needed to add in /etc/dovecot/conf.d/15-mailboxes the 2 folder I want to add, like this :
mailbox "Sent Messages" {
special_use = \Sent
}
mailbox Spam {
#special_use = \Spam
auto=subscribe
}
mailbox SpamFalse {
#special_use = \SpamFalse
auto=subscribe
}
# If you have a virtual "All messages" mailbox:
#mailbox virtual/All {
# special_use = \All
#}
Unfortunately it don't seem to work this way, conf.d folder don't even appears to be linked in dovecot.conf
So i added them in the /etc/dovecot/dovecot.conf file with the autocreate, but as I goggled this solution it seem deprecated.
And, must off all It didn't create folder where mailbox already exists.
So where i can add folder to existing mailboxes ?
My goal is, that spam who pass the filter (and vice-versa), can be moved by users in the "Spam" folder, which is periodically scanned by a script ( /spip/doc/Procmail/caremail/cron/sa-trap-sdbox like this one, adjust to the needs) who take email off all user to put them in spam@ or ham@. Those spam and ham address are after treated by another script ( /spip/doc/Procmail/caremail/sa-dspam-learn-sdbox ) which train dspam and spamassassin.
Those script run in crontab every X hours suited to your needs.
Is there requirements that could not be fit for iredmail ? Because this solution is way better for those who didn't use the webmail, and especially when it comes to explain to the 50years old technological refractors secretary how to handle spam...
DSPAM because the volume of spam that spamassassin let go is really outstanding (but working).
Please pardon my english im trying my best.