[spambayes-dev] Imap and Spam Bayes

Paul Wagland spambayes at kungfoocoder.org
Mon Oct 6 03:07:09 EDT 2003

On Mon, 2003-10-06 at 16:50, Meyer, Tony wrote:


> That would be fantastic.  This is (I presume) the same as [
> spambayes-Bugs-811759 ] Imap: odd message deletion behaviour:
> <https://sourceforge.net/tracker/?func=detail&atid=498103&aid=811759&gro
> up_id=61702>

Yes, this appears to be the problem, or at least very similar, to what I
was seeing...

> Any light you could shed on it would be fantastic.

I will have a look, but am shortly leaving for a holiday, so... :-)

But one thing that I can say is that the problem appears to go away when
you tell spambayes to expunge the mailbox when it is finished. Sadly,
this gets rid of *all* deleted messages, not just the one that spambayes
is creating :-\ But that is a limitation of the IMAP protocol if I
understand correctly?

> >  * (This is a suggestion) Make the IMAP client do IDLE requests
> >    where possible. Then it would not have to poll the IMAP server,
> >    and can just be notified when new mail is placed into the
> >    folders.
> Yes, this would probably be the nicer way to do it.  I considered it
> when writing imapfilter, but it seemed (and still does) like more work.
> I doubt that I personally will be able to find the time to do this in
> the near future, but if someone else wants to submit a patch, then I'd
> be happy to test it out and commit it.  Either way, it's probably a good
> idea to open a feature request (http://sf.net/projects/spambayes) for
> this, or it'll get lost among the traffic.

I have submitted the feature request, and will also look into this when
I get back...

However, this brings up my next interesting question :-)

Does the following sound reasonable/useful to anyone?

What I am thinking about is to create a general "IMAP watcher" framework
where we would be able to have multiple plugins (spambayes being the
prime candidate ;-) that get notified when a new message appears in a
"watched" folder. Each plugin would then have the opportunity to specify
a new destination folder for that message. Each plugin would also get
notified when the watcher had noticed that a message has moved from one
folder to another.

The reason behind this is that I would like to be able to perform the
following steps:
For any given incoming mail:
	If the mail is spam move it to the spam folder
	otherwise, if the mail is a reply to an already filed message, 		file
the incoming message into that folder
	otherwise, try to determine where the message should go 		statistically

Then (for spambayes) when an incoming message is received (and it is set
to learn) if it ends up in the INBOX then train it as HAM, if it ends up
in the unsure folder do not train, if it ends up in SPAM train it as

When moving messages: If it moves from unsure to SPAM or !SPAM then
train the message as SPAM or HAM. If it moves out of SPAM, untrain the
message as SPAM. If it moves out of !SPAM & !unsure untrain the message
as HAM.


Does it make sense? Is anyone interested?


More information about the spambayes-dev mailing list