Mercurial > p > roundup > code
comparison roundup/mailgw.py @ 521:1416195a830d
[SF#502342] pipe interface
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Fri, 11 Jan 2002 22:59:01 +0000 |
| parents | 3f6107488465 |
| children | dce4c75bef5a |
comparison
equal
deleted
inserted
replaced
| 520:1ebd38ababc9 | 521:1416195a830d |
|---|---|
| 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.49 2002-01-10 06:19:18 richard Exp $ | 76 $Id: mailgw.py,v 1.50 2002-01-11 22:59:01 richard Exp $ |
| 77 ''' | 77 ''' |
| 78 | 78 |
| 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 | 81 import time, random |
| 226 content_type = message.getheader(header_name) | 226 content_type = message.getheader(header_name) |
| 227 elif message.getheader(header_name): | 227 elif message.getheader(header_name): |
| 228 w.addheader(header_name, message.getheader(header_name)) | 228 w.addheader(header_name, message.getheader(header_name)) |
| 229 # now attach the message body | 229 # now attach the message body |
| 230 body = w.startbody(content_type) | 230 body = w.startbody(content_type) |
| 231 message.rewindbody() | 231 try: |
| 232 body.write(message.fp.read()) | 232 message.rewindbody() |
| 233 except IOError: | |
| 234 body.write("*** couldn't include message body: read from pipe ***") | |
| 235 else: | |
| 236 body.write(message.fp.read()) | |
| 233 | 237 |
| 234 # attach the original message to the returned message | 238 # attach the original message to the returned message |
| 235 part = writer.nextpart() | 239 part = writer.nextpart() |
| 236 part.addheader('Content-Disposition','attachment') | 240 part.addheader('Content-Disposition','attachment') |
| 237 part.addheader('Content-Description','Message that caused the error') | 241 part.addheader('Content-Description','Message that caused the error') |
| 724 l.append(section) | 728 l.append(section) |
| 725 return summary, '\n\n'.join(l) | 729 return summary, '\n\n'.join(l) |
| 726 | 730 |
| 727 # | 731 # |
| 728 # $Log: not supported by cvs2svn $ | 732 # $Log: not supported by cvs2svn $ |
| 733 # Revision 1.49 2002/01/10 06:19:18 richard | |
| 734 # followup lines directly after a quoted section were being eaten. | |
| 735 # | |
| 729 # Revision 1.48 2002/01/08 04:12:05 richard | 736 # Revision 1.48 2002/01/08 04:12:05 richard |
| 730 # Changed message-id format to "<%s.%s.%s%s@%s>" so it complies with RFC822 | 737 # Changed message-id format to "<%s.%s.%s%s@%s>" so it complies with RFC822 |
| 731 # | 738 # |
| 732 # Revision 1.47 2002/01/02 02:32:38 richard | 739 # Revision 1.47 2002/01/02 02:32:38 richard |
| 733 # ANONYMOUS_ACCESS -> ANONYMOUS_REGISTER | 740 # ANONYMOUS_ACCESS -> ANONYMOUS_REGISTER |
