rspamd for courier-mta

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

rspamd for courier-mta

Mark Constable
I've been looking for a lightweight faster amavisd/spamassassin
replacement for years and generally rely on just SpamProbe so
this is very interesting. Has anyone tried this with courier-mta?

https://rspamd.com/doc/integration.html

------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|

Re: rspamd for courier-mta

Ben Kennedy
On 13 Jan 2017, at 8:29 pm, Mark Constable <[hidden email]> wrote:

> I've been looking for a lightweight faster amavisd/spamassassin
> replacement for years and generally rely on just SpamProbe so
> this is very interesting. Has anyone tried this with courier-mta?

I have nothing to contribute except to add my interest to this as well.  I've been running SpamAssassin for years, but with poorer and poorer results, and have been keen to find an alternative.  I'd not heard of rspamd; looks like it could be the thing.

-ben


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|

Re: rspamd for courier-mta

Mark Constable
On 17/01/17 06:59, Ben Kennedy wrote:
>> Has anyone tried this with courier-mta?
>
> I have nothing to contribute except to add my interest to this as
> well. I've been running SpamAssassin for years, but with poorer and
> poorer results, and have been keen to find an alternative.

FWIW atm I only use spamprobe via maildop using 2 IMAP retraining
folders (super simple setup, no ram hogging daemons) and out of ~30
spams per day I get about 2 or 3 spams per week that get through to
my Inbox. But its taken a year of training to get to this point.

> I'd not heard of rspamd; looks like it could be the thing.

It's a monster unto itself and the only way I've got it to work is
by installing mailcow-dockerized which I'm trying to "flatten" out
so it doesn't require docker containers. It's not as light as I
hoped it might be but it should be fast being written in C by a
Russian (shades of nginx.) This is it's startup state and it will
spawn many more processes under load but it's still only half as
much as spamassassin would use...

ps -eo rss:10,vsz:10,cmd --sort=rss | grep rspamd

       4580     327444 rspamd: hs_helper process
       5648     327436 rspamd: main process
      59664     402564 rspamd: controller process
      60300     478416 rspamd: normal process

In the postfix world it's called via rmilter (which also uses
redis for caching so that is another ram sinkhole)...

main.cf:smtpd_milters = unix:/var/run/rmilter/rmilter.sock

which has this rspamd config option in /etc/rmilter.conf...

spamd {
   extended_spam_headers = yes
   servers = r:localhost:11333;
   reject_message = "Spam message rejected; If this is not spam contact abuse";
   whitelist = 127.0.0.1/32, 192.168.0.0/16, [::1]/128;
   [...]]
};

so rspamd is expected on localhost:11333 and runs quite a range
of tests including a baysean filter and also uses LUA to provide
a huge level of configurability...

classifier "bayes" {
   tokenizer {
     name = "osb";
   }
   cache {
     path = "${DBDIR}/learn_cache.sqlite";
   }
   statfile {
     symbol = "BAYES_HAM";
     path = "${DBDIR}/bayes.ham.sqlite";
     spam = false;
   }
   statfile {
     symbol = "BAYES_SPAM";
     path = "${DBDIR}/bayes.spam.sqlite";
     spam = true;
   }
   learn_condition =<<EOD
return function(task, is_spam, is_unlearn)
[... the rest of an embedded LUA function ...]

then dovecot has hooks to call into rspamd for retraining...

dovecot.conf:  antispam_mail_sendmail = /usr/local/bin/rspamd-pipe

which can take advantage of the dovecot-antispam plugin that
dynamically retrains spam when items are moved in or out of a
Junk folder (interesting use of curl)...

#!/bin/bash
if [[ ${2} == "learn_spam" ]]; then
/usr/bin/curl --data-binary @- http://localhost:11334/learnspam < /dev/stdin
elif [[ ${2} == "learn_ham" ]]; then
/usr/bin/curl --data-binary @- http://localhost:11334/learnham < /dev/stdin
fi
exit 0

I haven't got this all working properly yet to even begin to know
how to hook this into courier-mta.

One thing I've learned from messing around with postfix/dovecot the
past month or so is that courier-mta (inc Sam and this list) is the
BEST most efficient MTA/IMAP combo by far. Unfortunately with the
lack of uptodate (*buntu) packages and zero PHP management frontends
I find I have to try and become... ambidextrous.

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users
Reply | Threaded
Open this post in threaded view
|

Re: rspamd for courier-mta

Alessandro Vesely
On Tue 17/Jan/2017 04:11:09 +0100 Mark Constable wrote:
> [...] which can take advantage of the dovecot-antispam plugin that
> dynamically retrains spam when items are moved in or out of a Junk folder
> (interesting use of curl)...

Courier-IMAP has been lacking that hook for ever.  Patching would seem easier
than learning to become "ambidextrous"...

Ale
--













------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
courier-users mailing list
[hidden email]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users