[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r18308: {bridgedb} Actually enforce EMAIL_DOMAINS list. (bridgedb/trunk/lib/bridgedb)



Author: nickm
Date: 2009-01-28 16:01:36 -0500 (Wed, 28 Jan 2009)
New Revision: 18308

Modified:
   bridgedb/trunk/lib/bridgedb/Server.py
Log:
Actually enforce EMAIL_DOMAINS list.

Modified: bridgedb/trunk/lib/bridgedb/Server.py
===================================================================
--- bridgedb/trunk/lib/bridgedb/Server.py	2009-01-28 19:53:03 UTC (rev 18307)
+++ bridgedb/trunk/lib/bridgedb/Server.py	2009-01-28 21:01:36 UTC (rev 18308)
@@ -191,6 +191,9 @@
         logging.info("Couldn't parse domain from %r", clientAddr)
     if addrdomain and ctx.cfg.EMAIL_DOMAIN_MAP:
         addrdomain = ctx.cfg.EMAIL_DOMAIN_MAP.get(addrdomain, addrdomain)
+    if addrdomain not in ctx.cfg.EMAIL_DOMAINS:
+        logging.info("Unrecognized email domain %r", addrdomain)
+        return None,None
     rules = ctx.cfg.EMAIL_DOMAIN_RULES.get(addrdomain, [])
     if 'dkim' in rules:
         # getheader() returns the last of a given kind of header; we want