Mercurial > p > roundup > code
changeset 3374:3f12b4bcf796 maint-0.8
merge from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 24 Jun 2005 07:19:04 +0000 |
| parents | 086c634156e6 |
| children | 446f769b813b |
| files | CHANGES.txt doc/index.txt roundup/mailgw.py |
| diffstat | 3 files changed, 17 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/CHANGES.txt Fri Jun 24 07:17:08 2005 +0000 +++ b/CHANGES.txt Fri Jun 24 07:19:04 2005 +0000 @@ -19,7 +19,7 @@ popups (sf bug 1211800) - handle dropped properies in rdbms/metakit journal export (sf bug 1203569) - handle missing Subject lines better (sf bug 1198729) -- sort/group by missing values correctly (sf bug 1198623) +- sort/group by missing values correctly (sf bugs 1198623, 1176897) - discard, don't bounce messages to the mailgw when the messages's sender is invalid (ie. when we try to bounce, we get a 550 "unknown user account" response from the SMTP server) (sf bug 1190906)
--- a/doc/index.txt Fri Jun 24 07:17:08 2005 +0000 +++ b/doc/index.txt Fri Jun 24 07:19:04 2005 +0000 @@ -151,6 +151,7 @@ Darryl VanDorp, J Vickroy, William (Wilk), +Matt Wilbert, Chris Withers.
--- a/roundup/mailgw.py Fri Jun 24 07:17:08 2005 +0000 +++ b/roundup/mailgw.py Fri Jun 24 07:19:04 2005 +0000 @@ -72,7 +72,7 @@ an exception, the original message is bounced back to the sender with the explanatory message given in the exception. -$Id: mailgw.py,v 1.159.2.5 2005-06-24 06:48:17 richard Exp $ +$Id: mailgw.py,v 1.159.2.6 2005-06-24 07:17:08 richard Exp $ """ __docformat__ = 'restructuredtext' @@ -81,7 +81,7 @@ import traceback, MimeWriter, rfc822 from roundup import hyperdb, date, password, rfc2822, exceptions -from roundup.mailer import Mailer +from roundup.mailer import Mailer, MessageSendError SENDMAILDEBUG = os.environ.get('SENDMAILDEBUG', '') @@ -546,7 +546,19 @@ # just inform the user that he is not authorized m = [''] m.append(str(value)) - self.mailer.bounce_message(message, [sendto[0][1]], m) + try: + self.mailer.bounce_message(message, [sendto[0][1]], m) + except MessageSendError, error: + # if the only reason the bounce failed is because of + # invalid addresses to bounce the message back to, then + # just discard the message - it's just not worth bothering + # with (most likely spam / otherwise forged) + invalid = True + for address, (code, reason) in error.keys(): + if code != 550: + invalid = False + if not invalid: + raise except IgnoreMessage: # do not take any action # this exception is thrown when email should be ignored
