sa_learn + postfix/dovecot

4 posts / 0 new
Last post
#1 Mon, 07/07/2008 - 09:32
maxslug

sa_learn + postfix/dovecot

Hi all,

Has anyone worked out a system so that each user has "learn spam" "learn ham" folders in IMAP? What I would like is to for users to be able to drag a spam message into one of these folders and for sa_learn to be called.

I've found various cron job solutions that would monitor these folders, but that sounds like a PITA to implement for a lot of domains. I was hoping there was something more callback-style that was implemented in dovecot or postfix that would fire off sa_learn when the either of the "learn" folders was called.

Optionally, it would be cool that after you dropped it into the "learn ham" folder it would strip off the spamassassin junk and drop it back into your inbox.

Related Links: http://www.dovecot.org/list/dovecot/2008-January/028413.html http://www.rockytop.net/dovecot_imap.php http://wiki.apache.org/spamassassin/RemoteImapFolder

Has anyone done this yet under virtualmin?

Thanks, -m

Sat, 05/16/2009 - 00:57
fdzicher

Hello,

I've just made two commands for learning spam/ham

sa_learn_spam
[code:1]#!/bin/bash

/usr/bin/sa-learn --spam /home/*/homes/*/Maildir/.Junk/cur[/code:1]
sa_learn_ham
[code:1]#!/bin/bash

/usr/bin/sa-learn --ham /home/*/homes/*/Maildir/.Ham/cur[/code:1]
and call them with a cron job

HTH
Frank

Post edited by: fdzicher, at: 2009/05/16 00:58<br><br>Post edited by: fdzicher, at: 2009/05/16 00:58

Thu, 12/17/2009 - 13:57
maxslug

I finally got around to making the script that I wanted. This will tkae things from the 'ham' folder, clean them up, and return them to the inbox.

Thanks for the start Frank, that helped a lot!

Download it from here : http://warped.org/blog/2009/12/17/spam-ham-learning-folders-for-virtualm...

-m

Sun, 02/14/2010 - 23:49 (Reply to #3)
NotteScura

Awesome guys! Thanks!

Was able to use the script and modify slightly to suit my needs. (Remove both spam and ham from folders, rather than moving ham back to inbox.)

NS

Topic locked