Mercurial > p > roundup > code
comparison roundup/mailgw.py @ 3976:7dc74da6c3e8
Fix mailgw total failure bounce message generation (thanks Bradley Dean)
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 23 Jul 2008 03:04:44 +0000 |
| parents | 22339538cf10 |
| children | 4b0ddce43d08 |
comparison
equal
deleted
inserted
replaced
| 3975:48457385bf61 | 3976:7dc74da6c3e8 |
|---|---|
| 71 set() method to add the message to the item's spool; in the second case we | 71 set() method to add the message to the item's spool; in the second case we |
| 72 are calling the create() method to create a new node). If an auditor raises | 72 are calling the create() method to create a new node). If an auditor raises |
| 73 an exception, the original message is bounced back to the sender with the | 73 an exception, the original message is bounced back to the sender with the |
| 74 explanatory message given in the exception. | 74 explanatory message given in the exception. |
| 75 | 75 |
| 76 $Id: mailgw.py,v 1.195 2008-02-07 03:33:31 richard Exp $ | 76 $Id: mailgw.py,v 1.196 2008-07-23 03:04:44 richard Exp $ |
| 77 """ | 77 """ |
| 78 __docformat__ = 'restructuredtext' | 78 __docformat__ = 'restructuredtext' |
| 79 | 79 |
| 80 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri | 80 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri |
| 81 import time, random, sys, logging | 81 import time, random, sys, logging |
| 346 # multipart/form-data: | 346 # multipart/form-data: |
| 347 # For web forms only. | 347 # For web forms only. |
| 348 | 348 |
| 349 def extract_content(self, parent_type=None, ignore_alternatives = False): | 349 def extract_content(self, parent_type=None, ignore_alternatives = False): |
| 350 """Extract the body and the attachments recursively. | 350 """Extract the body and the attachments recursively. |
| 351 | 351 |
| 352 If the content is hidden inside a multipart/alternative part, | 352 If the content is hidden inside a multipart/alternative part, |
| 353 we use the *last* text/plain part of the *first* | 353 we use the *last* text/plain part of the *first* |
| 354 multipart/alternative in the whole message. | 354 multipart/alternative in the whole message. |
| 355 """ | 355 """ |
| 356 content_type = self.gettype() | 356 content_type = self.gettype() |
| 766 # let the admin know that something very bad is happening | 766 # let the admin know that something very bad is happening |
| 767 m = [''] | 767 m = [''] |
| 768 m.append('An unexpected error occurred during the processing') | 768 m.append('An unexpected error occurred during the processing') |
| 769 m.append('of your message. The tracker administrator is being') | 769 m.append('of your message. The tracker administrator is being') |
| 770 m.append('notified.\n') | 770 m.append('notified.\n') |
| 771 self.mailer.bounce_message(message, sendto[0][1], m) | 771 self.mailer.bounce_message(message, [sendto[0][1]], m) |
| 772 | 772 |
| 773 m.append('----------------') | 773 m.append('----------------') |
| 774 m.append(traceback.format_exc()) | 774 m.append(traceback.format_exc()) |
| 775 self.mailer.bounce_message(message, [self.instance.config.ADMIN_EMAIL], m) | 775 self.mailer.bounce_message(message, [self.instance.config.ADMIN_EMAIL], m) |
| 776 | 776 |
