Mercurial > p > roundup > code
comparison roundup/mailer.py @ 3667:35811df7c783
fix error during mailgw bouncing message [SF#1413501]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 11 Aug 2006 01:41:25 +0000 |
| parents | a052781093d7 |
| children | 6d14a3b4e295 |
comparison
equal
deleted
inserted
replaced
| 3666:8304a1c1cc98 | 3667:35811df7c783 |
|---|---|
| 1 """Sending Roundup-specific mail over SMTP. | 1 """Sending Roundup-specific mail over SMTP. |
| 2 """ | 2 """ |
| 3 __docformat__ = 'restructuredtext' | 3 __docformat__ = 'restructuredtext' |
| 4 # $Id: mailer.py,v 1.17 2006-02-21 05:48:23 a1s Exp $ | 4 # $Id: mailer.py,v 1.18 2006-08-11 01:41:25 richard Exp $ |
| 5 | 5 |
| 6 import time, quopri, os, socket, smtplib, re, sys, traceback | 6 import time, quopri, os, socket, smtplib, re, sys, traceback |
| 7 | 7 |
| 8 from cStringIO import StringIO | 8 from cStringIO import StringIO |
| 9 from MimeWriter import MimeWriter | 9 from MimeWriter import MimeWriter |
| 139 else: | 139 else: |
| 140 body.write(bounced_message.fp.read()) | 140 body.write(bounced_message.fp.read()) |
| 141 | 141 |
| 142 writer.lastpart() | 142 writer.lastpart() |
| 143 | 143 |
| 144 self.smtp_send(to, message) | 144 try: |
| 145 self.smtp_send(to, message) | |
| 146 except MessageSendError: | |
| 147 # squash mail sending errors when bouncing mail | |
| 148 # TODO this *could* be better, as we could notify admin of the | |
| 149 # problem (even though the vast majority of bounce errors are | |
| 150 # because of spam) | |
| 151 pass | |
| 145 | 152 |
| 146 def exception_message(self): | 153 def exception_message(self): |
| 147 '''Send a message to the admins with information about the latest | 154 '''Send a message to the admins with information about the latest |
| 148 traceback. | 155 traceback. |
| 149 ''' | 156 ''' |
