summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-20 17:50:54 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-03-20 17:50:54 +0100
commitecf63205e0538ddbaac083b61dcbcbf0c4623b80 (patch)
tree2fb47972a29b3f3b40aee6a02904a8af22c53170
parent18f35345380722f87416ff8d021a4dd133af19db (diff)
downloadpykolab-ecf63205e0538ddbaac083b61dcbcbf0c4623b80.tar.gz
Update wallace to comply with some pylint warnings/errors
-rw-r--r--wallace/__init__.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 0230c64..c85e0fe 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -70,19 +70,22 @@ class WallaceDaemon(object):
We have retrieved the message.
- Dispatch to virus-scanning and anti-spam filtering?
+ Not for now. We use some sort of re-injection.
+
- Apply access policies;
- Maximum number of recipients,
- kolabAllowSMTPSender,
- kolabAllowSMTPRecipient,
- Rule-based matching against white- and/or blacklist
- ...
+
- Accounting
+
- Data Loss Prevention
"""
inheaders = 1
(fp, filename) = tempfile.mkstemp(dir="/var/spool/pykolab/wallace/")
-
os.write(fp, data)
os.close(fp)
@@ -266,15 +269,11 @@ class WallaceDaemon(object):
time.sleep(1)
- # Sleep longer if last time around we didn't find any deferred
- # message files
- if file_count > 0:
- log.debug(_("Sleeping for 1 second"), level=8)
- time.sleep(1)
- else:
- log.debug(_("Sleeping for 1800 seconds"), level=8)
- time.sleep(1800)
-
+ # Sleep for 300 seconds before reprocessing the deferred queues.
+ # TODO: Consider using queue_run_delay from Postfix, which is where
+ # the default value of 300 seconds comes from.
+ log.debug(_("Sleeping for 300 seconds"), level=8)
+ time.sleep(300)
def do_wallace(self):
import binascii
@@ -343,7 +342,8 @@ class WallaceDaemon(object):
if module.lower() == "defer":
# Wallace was unable to deliver to re-injection smtpd.
- # Skip it, another thread is picking up the defers.
+ # Skip it, another thread is picking up the deferred
+ # messages.
continue
stage = root.replace(pickup_path, '').split('/')
@@ -417,7 +417,7 @@ class WallaceDaemon(object):
#print "Accepted connection from %r" % (address)
channel = SMTPChannel(self, connection, address)
asyncore.loop()
- except Exception, e:
+ except Exception, errmsg:
traceback.print_exc()
s.shutdown(1)
s.close()