summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-22 13:05:53 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-22 13:05:53 -0400
commitb34c2a611bb3e76526d17a651fae4aa669ba8f43 (patch)
tree468663d1a61fca80e9b84aa0cbabb0d50f2b9d00 /wallace
parent38a99ecd5b487fe47c84c970a1bb50dd5627735d (diff)
downloadpykolab-b34c2a611bb3e76526d17a651fae4aa669ba8f43.tar.gz
Basic sanity check for input message
Diffstat (limited to 'wallace')
-rw-r--r--wallace/module_resources.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index aa3c473..0eb4659 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -160,6 +160,10 @@ def execute(*args, **kw):
# parse full message
message = Parser().parse(open(filepath, 'r'))
+ # invalid message, skip
+ if not message.get('X-Kolab-To'):
+ return filepath
+
recipients = [address for displayname,address in getaddresses(message.get_all('X-Kolab-To'))]
sender_email = [address for displayname,address in getaddresses(message.get_all('X-Kolab-From'))][0]