Mercurial > p > roundup > code
comparison roundup/mailgw.py @ 545:d276d72ebdaf
if the attachment has no name, name it unnamed, happens with tnefs.
| author | Engelbert Gruber <grubert@users.sourceforge.net> |
|---|---|
| date | Wed, 16 Jan 2002 09:14:45 +0000 |
| parents | d32977eb8bd4 |
| children | d7b9751f8927 |
comparison
equal
deleted
inserted
replaced
| 544:d32977eb8bd4 | 545:d276d72ebdaf |
|---|---|
| 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.53 2002-01-16 07:20:54 richard Exp $ | 76 $Id: mailgw.py,v 1.54 2002-01-16 09:14:45 grubert 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 |
| 536 # | 536 # |
| 537 # handle the attachments | 537 # handle the attachments |
| 538 # | 538 # |
| 539 files = [] | 539 files = [] |
| 540 for (name, mime_type, data) in attachments: | 540 for (name, mime_type, data) in attachments: |
| 541 if not name: | |
| 542 name = "unnamed" | |
| 541 files.append(self.db.file.create(type=mime_type, name=name, | 543 files.append(self.db.file.create(type=mime_type, name=name, |
| 542 content=data)) | 544 content=data)) |
| 543 | 545 |
| 544 # | 546 # |
| 545 # now handle the db stuff | 547 # now handle the db stuff |
| 745 l.append(section) | 747 l.append(section) |
| 746 return summary, '\n\n'.join(l) | 748 return summary, '\n\n'.join(l) |
| 747 | 749 |
| 748 # | 750 # |
| 749 # $Log: not supported by cvs2svn $ | 751 # $Log: not supported by cvs2svn $ |
| 752 # Revision 1.53 2002/01/16 07:20:54 richard | |
| 753 # simple help command for mailgw | |
| 754 # | |
| 750 # Revision 1.52 2002/01/15 00:12:40 richard | 755 # Revision 1.52 2002/01/15 00:12:40 richard |
| 751 # #503340 ] creating issue with [asignedto=p.ohly] | 756 # #503340 ] creating issue with [asignedto=p.ohly] |
| 752 # | 757 # |
| 753 # Revision 1.51 2002/01/14 02:20:15 richard | 758 # Revision 1.51 2002/01/14 02:20:15 richard |
| 754 # . changed all config accesses so they access either the instance or the | 759 # . changed all config accesses so they access either the instance or the |
