@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373an exception, the original message is bounced back to the sender with the
7474explanatory message given in the exception.
7575
76- $Id: mailgw.py,v 1.135 2003-10-25 12:03:41 jlgijsbers Exp $
76+ $Id: mailgw.py,v 1.136 2003-11-03 18:34:03 jlgijsbers Exp $
7777"""
7878
7979import string , re , os , mimetools , cStringIO , smtplib , socket , binascii , quopri
@@ -789,27 +789,27 @@ def handle_message(self, message):
789789 #
790790 # handle the attachments
791791 #
792- files = []
793- for ( name , mime_type , data ) in attachments :
794- if not name :
795- name = "unnamed"
796- files . append ( self . db . file . create ( type = mime_type , name = name ,
797- content = data , ** file_props ))
798- # attach the files to the issue
799- if nodeid :
800- # extend the existing files list
801- fileprop = cl . get ( nodeid , ' files' )
802- fileprop . extend ( files )
803- props [ 'files' ] = fileprop
804- else :
805- # pre-load the files list
806- props [ 'files' ] = files
807-
792+ if properties . has_key ( 'files' ):
793+ files = []
794+ for ( name , mime_type , data ) in attachments :
795+ if not name :
796+ name = "unnamed"
797+ files . append ( self . db . file . create ( type = mime_type , name = name ,
798+ content = data , ** file_props ))
799+ # attach the files to the issue
800+ if nodeid :
801+ # extend the existing files list
802+ fileprop = cl . get ( nodeid , ' files' )
803+ fileprop . extend ( files )
804+ props [ 'files' ] = fileprop
805+ else :
806+ # pre-load the files list
807+ props [ 'files' ] = files
808808
809809 #
810810 # create the message if there's a message body (content)
811811 #
812- if content :
812+ if ( content and properties . has_key ( 'messages' )) :
813813 message_id = self .db .msg .create (author = author ,
814814 recipients = recipients , date = date .Date ('.' ), summary = summary ,
815815 content = content , files = files , messageid = messageid ,
0 commit comments