summaryrefslogtreecommitdiff
path: root/pkg/mx.tac
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2014-09-08 15:52:34 -0300
committerTomás Touceda <chiiph@leap.se>2014-09-11 14:33:01 -0300
commit47bf4c701eb84ec06c9a63adb3c8cc99876eaf66 (patch)
treea24da1845fbeb781947a5091b9fcb558881039d2 /pkg/mx.tac
parent5f3f5e47f44876d4da82623b6585d30618ed40df (diff)
Implement mail bouncing under certain problematic situations
Diffstat (limited to 'pkg/mx.tac')
-rwxr-xr-xpkg/mx.tac14
1 files changed, 12 insertions, 2 deletions
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)