diff options
author | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2014-10-11 21:29:49 +0200 |
---|---|---|
committer | Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> | 2014-10-11 21:30:55 +0200 |
commit | 9a2d4304627900d5d692189870ff96b5d6ce5174 (patch) | |
tree | 10af5f21ee2cd17822dc2ecacd6b93c78f24576e /wallace | |
parent | 75f998a71169fb0cf8e95633614316c8a455fe32 (diff) | |
download | pykolab-9a2d4304627900d5d692189870ff96b5d6ce5174.tar.gz |
Fall back to accept a message if no module has anything to say about it
Diffstat (limited to 'wallace')
-rw-r--r-- | wallace/__init__.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py index 1108ead..41db60a 100644 --- a/wallace/__init__.py +++ b/wallace/__init__.py @@ -40,6 +40,8 @@ from pykolab.translate import _ log = pykolab.getLogger('pykolab.wallace') conf = pykolab.getConf() +from modules import cb_action_ACCEPT + #conf.finalize_conf() #if conf.debuglevel > 8: # max_threads = 1 @@ -62,6 +64,10 @@ def pickup_message(filepath, *args, **kw): else: modules.execute(kw['module'], filepath) + # After all modules are executed, continue with a call to + # accept the message and re-inject in to Postfix. + continue_with_accept = True + for module in wallace_modules: try: result_filepath = modules.execute(module, filepath) @@ -72,7 +78,11 @@ def pickup_message(filepath, *args, **kw): if not result_filepath == None and not result_filepath == False: filepath = result_filepath else: - break + # A module has returned False or None + continue_with_accept = False + + if continue_with_accept: + cb_action_ACCEPT('wallace', filepath) def worker_process(*args, **kw): log.debug(_("Worker process %s initializing") % (multiprocessing.current_process().name), level=1) |