KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > suberic > pooka > filter > SpamSearchTerm


1 package net.suberic.pooka.filter;
2 import javax.mail.*;
3 import javax.mail.search.*;
4 import net.suberic.pooka.*;
5
6 /**
7  * This is a SearchTerm which checks for Spam.
8  */

9 public class SpamSearchTerm extends SearchTerm {
10
11   SpamFilter filter = null;
12
13   /**
14    * Creates the given SpamSearchTerm.
15    */

16   public SpamSearchTerm () {
17     //filter = new SpamAssassinSpamFilter();
18
}
19   
20   /**
21    * Checks to see if the given Message is a spam of one that
22    * already exists in the FolderInfo.
23    */

24   public boolean match(Message m) {
25     if (filter != null)
26       return filter.isSpam(m);
27     else
28       return false;
29   }
30 }
31
Popular Tags