diff options
Diffstat (limited to 'src/whitelist.py')
-rw-r--r-- | src/whitelist.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/whitelist.py b/src/whitelist.py index 4e02f0e..abb5d24 100644 --- a/src/whitelist.py +++ b/src/whitelist.py @@ -15,7 +15,6 @@ whitelist manage a list of trusted user. from __future__ import absolute_import import logging # logging.basicConfig(level=logging.DEBUG) -import sys import time import wlp @@ -54,8 +53,7 @@ class whitelist(object): # limitation. if fromhead.find(self.wl[owner]['From:']) >= 0: return owner - else: - return None + return None def logmsg(self, heads, ok=DENY, owner=None): """who are walking through my gate? @@ -75,25 +73,25 @@ class whitelist(object): self.logger.info('at %s (%s)', ltime, tzone) if owner is not None: - self.logger.debug('\tWLOwner: ' + owner + '') - self.logger.debug('\tFrom: ' + heads.get('From', 'NOT PRESENT')) - self.logger.debug('\tSubject: ' + heads.get('Subject', 'NOT PRESENT')) - self.logger.debug('\tSender: ' + heads.get('Sender', 'NOT PRESENT')) - self.logger.debug('\tDate: ' + heads.get('Date', 'NOT PRESENT')) + self.logger.debug('\tWLOwner: %s', owner) + self.logger.debug('\tFrom: %s', heads.get('From', 'NOT PRESENT')) + self.logger.debug('\tSubject: %s', heads.get('Subject', 'NOT PRESENT')) + self.logger.debug('\tSender: %s', heads.get('Sender', 'NOT PRESENT')) + self.logger.debug('\tDate: %s', heads.get('Date', 'NOT PRESENT')) # some client create Message-Id other Message-ID. if 'Message-ID' in heads: - self.logger.debug('\tMessage-ID: ' + heads.get('Message-ID')) + self.logger.debug('\tMessage-ID: %s', heads.get('Message-ID')) else: - self.logger.debug('\tMessage-Id: ' + heads.get('Message-Id', + self.logger.debug('\tMessage-Id: %s', heads.get('Message-Id', 'NOT PRESENT')) # X-Newsgroups: and To: are present if user is trusted, else # Newsgroup: exists since no changes on nntp headers are done. if 'X-Newsgroups' in heads: - self.logger.debug('\tTo: ' + heads.get('To', 'NOT PRESENT')) - self.logger.debug('\tX-Newsgroups: ' + heads.get('X-Newsgroups', + self.logger.debug('\tTo: %s', heads.get('To', 'NOT PRESENT')) + self.logger.debug('\tX-Newsgroups: %s', heads.get('X-Newsgroups', 'NOT PRESENT')) else: - self.logger.debug('\tNewsgroups: ' + + self.logger.debug('\tNewsgroups: %s', heads.get('Newsgroups', 'NOT PRESENT')) |