sa_learn + postfix/dovecot

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

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:

Has anyone done this yet under virtualmin?

Thanks, -m

Sat, 05/16/2009 - 00:57


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


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

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


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

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 :


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

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.)


Topic locked