summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-09-26 10:21:00 -0300
committerTomás Touceda <chiiph@leap.se>2014-09-26 10:21:00 -0300
commitd8893584886a593dd6ddcfa1a6930288c7fd8ecc (patch)
treeea78d499b35991a7e1e51ebbb8aee6fea6286ff1 /pkg
parent2b6ed340fd0f2f84431082890857dd5e7de63831 (diff)
parent78e8f04076c4f915b8fbdad037a863487580da5a (diff)
Merge branch 'release-0.6.0'0.6.0
Diffstat (limited to 'pkg')
-rw-r--r--pkg/mx.conf.sample19
-rwxr-xr-xpkg/mx.tac14
2 files changed, 31 insertions, 2 deletions
diff --git a/pkg/mx.conf.sample b/pkg/mx.conf.sample
new file mode 100644
index 0000000..c9ad0f8
--- /dev/null
+++ b/pkg/mx.conf.sample
@@ -0,0 +1,19 @@
+[mail1]
+path=/path/to/Maildir/
+recursive=<whether to analyze the above path recursively or not (True/False)>
+
+[couchdb]
+user=<couch user>
+password=<password>
+server=localhost
+port=6666
+
+[alias map]
+port=4242
+
+[check recipient]
+port=2244
+
+[bounce]
+from=<address for the From: of the bounce email without domain>
+subject=Delivery failure \ No newline at end of file
diff --git a/pkg/mx.tac b/pkg/mx.tac
index c101de9..75d2405 100755
--- a/pkg/mx.tac
+++ b/pkg/mx.tac
@@ -46,6 +46,15 @@ password = config.get("couchdb", "password")
server = config.get("couchdb", "server")
port = config.get("couchdb", "port")
+bounce_from = "bounce"
+bounce_subject = "Delivery failure"
+
+try:
+ bounce_from = config.get("bounce", "from")
+ bounce_subject = config.get("bounce", "subject")
+except ConfigParser.NoSectionError:
+ pass # we use the defaults above
+
alias_port = config.getint("alias map", "port")
check_recipient_port = config.getint("check recipient", "port")
@@ -74,11 +83,12 @@ mail_couch_url_prefix = "http://%s:%s@%s:%s" % (user,
port)
directories = []
for section in config.sections():
- if section in ("couchdb", "alias map", "check recipient"):
+ if section in ("couchdb", "alias map", "check recipient", "bounce"):
continue
to_watch = config.get(section, "path")
recursive = config.getboolean(section, "recursive")
directories.append([to_watch, recursive])
-mr = MailReceiver(mail_couch_url_prefix, cdb, directories)
+mr = MailReceiver(mail_couch_url_prefix, cdb, directories, bounce_from,
+ bounce_subject)
mr.setServiceParent(application)