summaryrefslogtreecommitdiffstats
path: root/wallace
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-24 17:11:54 +0100
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-12-24 17:11:54 +0100
commit4ba6294b1ea93f42466d44f54726a8cf281cdd86 (patch)
tree737bc96771c6452ffbf37672c15fdad7f3041f6d /wallace
parentf40622f04115f2ecf8547f1dbebe0f88856492fa (diff)
downloadpykolab-4ba6294b1ea93f42466d44f54726a8cf281cdd86.tar.gz
Write out messages received to the spool as a JSON object that preserves the SMTP communication exchange (#1469)
Diffstat (limited to 'wallace')
-rw-r--r--wallace/__init__.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/wallace/__init__.py b/wallace/__init__.py
index 4b4792f..1e81eaa 100644
--- a/wallace/__init__.py
+++ b/wallace/__init__.py
@@ -21,6 +21,7 @@ import asyncore
import binascii
from distutils import version
import grp
+import json
import multiprocessing
import os
import pwd
@@ -241,6 +242,14 @@ class WallaceDaemon(object):
"""
inheaders = 1
+ data = json.dumps(
+ {
+ 'from': mailfrom,
+ 'to': rcpttos,
+ 'data': data
+ }
+ )
+
(fp, filename) = tempfile.mkstemp(dir="/var/spool/pykolab/wallace/")
os.write(fp, data)
os.close(fp)