[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[or-cvs] r21207: {projects} Drop bounce mails (projects/gettor/lib/gettor)
Author: kaner
Date: 2009-12-14 18:52:00 -0500 (Mon, 14 Dec 2009)
New Revision: 21207
Modified:
projects/gettor/lib/gettor/requests.py
Log:
Drop bounce mails
Modified: projects/gettor/lib/gettor/requests.py
===================================================================
--- projects/gettor/lib/gettor/requests.py 2009-12-14 23:45:56 UTC (rev 21206)
+++ projects/gettor/lib/gettor/requests.py 2009-12-14 23:52:00 UTC (rev 21207)
@@ -71,6 +71,16 @@
# Scrub this data
self.replytoAddress = self.parsedMessage["from"]
assert self.replytoAddress is not None, "No 'from' field in mail"
+
+ # Make sure we drop bounce mails
+ retpath = self.parsedMessage["Return-Path"]
+ #log.info("Return-path: \"%s\"" % retpath)
+ self.bounce = False
+ if retpath == "<>":
+ log.info("We've received a bounce")
+ self.bounce = True
+ assert self.bounce is not True, "We've got a bounce. Bye."
+
# If no package name could be recognized, use 'None'
self.returnPackage = None
self.splitDelivery = False