diff roundup/mailgw.py @ 2344:e295c086c246 maint-0.6

look harder for text/plain in email
author Richard Jones <richard@users.sourceforge.net>
date Thu, 20 May 2004 00:10:10 +0000
parents d2d574224110
children c15544c3a86a
line wrap: on
line diff
--- a/roundup/mailgw.py	Mon May 17 00:47:29 2004 +0000
+++ b/roundup/mailgw.py	Thu May 20 00:10:10 2004 +0000
@@ -73,7 +73,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.126.2.4 2004-04-10 22:10:48 richard Exp $
+$Id: mailgw.py,v 1.126.2.5 2004-05-20 00:10:10 richard Exp $
 """
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
@@ -817,6 +817,18 @@
                     data = self.get_part_data_decoded(part) 
                     attachments.append((name, part.gettype(), data))
 
+        elif content_type in ('multipart/alternative', 'multipart/signed'):
+            message.getPart()
+            content = None
+            while 1:
+                # get the next part
+                part = message.getPart()
+                if part is None:
+                    break
+                # if it's plain text, breathe a sigh of relief
+                if part.gettype() == 'text/plain' and not content:
+                    content = self.get_part_data_decoded(part) 
+
         elif content_type == 'text/plain':
             content = self.get_part_data_decoded(message) 
 

Roundup Issue Tracker: http://roundup-tracker.org/