Quantcast
Channel: iRedMail — iRedMail Support
Viewing all articles
Browse latest Browse all 12092

easy way to learn SA from webmail use dovecot + antispam in iredmail

$
0
0

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): mysql
- Linux/BSD distribution name and version: debian wheezy
- Related log if you're reporting an issue:
====


Hi
This is small faq to enable learning SA from webmail for vusers - antispam in dovecot for iredmail smile


1)install packages:

apt-get install dovecot-antispam

2)edit dovecot.conf

pico /etc/dovecot/dovecot.conf

find:

in sections plugin add:

plugin {

.......

antispam_debug_target = syslog
antispam_verbose_debug = 1
antispam_backend = pipe
antispam_trash = Trash
antispam_spam = Junk
antispam_pipe_program = /usr/bin/sa-learn-pipe.sh
antispam_pipe_program_spam_arg = --spam
antispam_pipe_program_notspam_arg = --ham

....
}

find sections protocol imap and add antispam

protocol imap {
    mail_plugins = $mail_plugins imap_quota acl imap_acl antispam

....
}

3)edit antispam_pipe_program:

pico /usr/bin/sa-learn-pipe.sh

---------------------- start -------------------------------------------------------

#!/bin/bash
echo /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt
echo "$$-start ($*)" >> /tmp/sa-learn-pipe.log

echo $* > /tmp/sendmail-parms.txt
cat<&0 >> /tmp/sendmail-msg-$$.txt

chmod 644 /tmp/sendmail-msg-$$.txt
sudo -u amavis /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt -u spamd --dbpath /var/lib/amavis/.spamassassin
echo sudo -u amavis /usr/bin/sa-learn $* /tmp/sendmail-msg-$$.txt -u spamd --dbpath /var/lib/amavis/.spamassassin >>  /tmp/sa-learn-pipe.log
echo $$ sa-learn rc=$? id=$(id) HOME=$HOME >> /tmp/sa-learn-pipe.log

rm -f /tmp/sendmail-msg-$$.txt

echo "$$-end" >> /tmp/sa-learn-pipe.log

exit 0

-------------------------------------------------- stop --------------------------------------------

chmod +x /usr/bin/sa-learn-pipe.sh

4)add user to sudo:

vmail ALL =(amavis) NOPASSWD: /usr/bin/sa-learn

5)edit config.inc.php in roundcube and add:

pico /usr/share/apache2/roundcubemail/config/config.inc.php

add:

$config['plugins'] = array('managesieve', 'password', 'acl', 'markasjunk', 'identity_select', 'new_user_identity');

6)now is done smile go to coffie or beer



How test:

su - amavis -s /bin/bash
sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0         26          0  non-token data: nspam
0.000          0         16          0  non-token data: nham
0.000          0       2047          0  non-token data: ntokens
0.000          0 1416931283          0  non-token data: oldest atime
0.000          0 1417689280          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync atime
0.000          0 1417652647          0  non-token data: last expiry atime
0.000          0          0          0  non-token data: last expire atime delta
0.000          0          0          0  non-token data: last expire reduction coun

now log to your e-mail acount in roundcube and add e-mail to spam and test:

sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0         27          0  non-token data: nspam
0.000          0         15          0  non-token data: nham
0.000          0       2047          0  non-token data: ntokens
0.000          0 1416931283          0  non-token data: oldest atime
0.000          0 1417689280          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync atime
0.000          0 1417652647          0  non-token data: last expiry atime
0.000          0          0          0  non-token data: last expire atime delta
0.000          0          0          0  non-token data: last expire reduction count

Im tuned more in iredmail but not write in post because this is free version because author iredmail can not accept smile


Viewing all articles
Browse latest Browse all 12092

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>