Index: tracspamfilter/filters/extlinks.py
===================================================================
--- tracspamfilter/filters/extlinks.py	(revision 8354)
+++ tracspamfilter/filters/extlinks.py	(working copy)
@@ -13,7 +13,7 @@
 
 import re
 
-from trac.config import IntOption
+from trac.config import ListOption, IntOption
 from trac.core import *
 from tracspamfilter.api import IFilterStrategy
 from tracspamfilter.model import LogEntry
@@ -33,15 +33,25 @@
         """The maximum number of external links allowed in a submission until
         that submission gets negative karma.""")
 
+    allowed_domains = ListOption('spam-filter', 'extlinks_allowed_domains',
+                                 'example.com, example.org', doc=
+        """List of domains that should be allowed in external links""")
+    
     _URL_RE = re.compile('https?://([^/]+)/?', re.IGNORECASE)
 
     # IFilterStrategy methods
 
     def test(self, req, author, content):
         num_ext = 0
+        allowed = self.allowed_domains
+        allowed.append(req.get_header('Host'))
+        
         for host in self._URL_RE.findall(content):
-            if host != req.get_header('Host'):
+            if host not in allowed:
+                self.env.log.debug('"%s" is not in extlink_allowed_domains' % host)
                 num_ext += 1
+            else:
+                self.env.log.debug('"%s" is whitelisted.' % host)
 
         if num_ext > self.max_links:
             return -abs(self.karma_points) * num_ext / self.max_links, \

