<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [Dovecot] Hooks on folder operations</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Hi Grahame,</FONT>
</P>

<P><FONT SIZE=2>> Hi all,</FONT>
<BR><FONT SIZE=2>> </FONT>
<BR><FONT SIZE=2>> I'm interested in implementing an anti-spam system using </FONT>
<BR><FONT SIZE=2>> bayesian filtering. I had the idea of modifying and IMAP </FONT>
<BR><FONT SIZE=2>> server to assist in training the spam filter.</FONT>
<BR><FONT SIZE=2>Why do you want to hook it up into your imap server? I think it would be better to prevent emails to enter the mailbox with the MTA rather than removing it when the user is reading his email using imap.</FONT></P>

<P><FONT SIZE=2>Why? Because the spam that is in the mailbox might push the user over his quota limit, and thus preventing legitimate emails to be delivered.</FONT></P>

<P><FONT SIZE=2>> I was thinking of running a program whenever a message in </FONT>
<BR><FONT SIZE=2>> moved to the folder "Spam" or to a "Safe" folder. This could </FONT>
<BR><FONT SIZE=2>> be easily added to the server as a generic feature, with hook </FONT>
<BR><FONT SIZE=2>> programs for:</FONT>
<BR><FONT SIZE=2>>   * new message in a folder (either new, or moved into the folder)</FONT>
<BR><FONT SIZE=2>>   * message in folder is modified</FONT>
<BR><FONT SIZE=2>>   * message in folder is removed</FONT>
<BR><FONT SIZE=2>> and so on. If the support was generic enough there could be </FONT>
<BR><FONT SIZE=2>> many uses for it. Security of the external program needs to </FONT>
<BR><FONT SIZE=2>> be considered but doesn't really affect the IMAP server itself.</FONT>
<BR><FONT SIZE=2>With the new API code that Timo is making now, I guess this would be possible.</FONT>
</P>

<P><FONT SIZE=2>(After all: if quota's are updated, something was written to the mailbox, or deleted of course!)</FONT>
</P>

<P><FONT SIZE=2>> Anyway, if I were to write a patch to add support for running </FONT>
<BR><FONT SIZE=2>> an external program in these cases, would it be included? Any </FONT>
<BR><FONT SIZE=2>> feedback would be appreciated, if I'm going to do this I </FONT>
<BR><FONT SIZE=2>> might as well do it in a way that can be integrated back into </FONT>
<BR><FONT SIZE=2>> the main tree!</FONT>
<BR><FONT SIZE=2>You can always build a plugin, and plugins can be loaded whenever an administrator wants them to load. I don't know if Timo wants to include all plugins that are / will be written for dovecot, but I guess there might be a plugins part, where people can "post" their plugins so other people can benefit from them :)</FONT></P>

<P><FONT SIZE=2>> Cheers</FONT>
<BR><FONT SIZE=2>> Grahame</FONT>
</P>

<P><FONT SIZE=2>Kind regards,</FONT>
</P>

<P><FONT SIZE=2>Maikel Verheijen</FONT>
</P>

</BODY>
</HTML>