Changeset 569


Ignore:
Timestamp:
09/13/11 16:07:06 (10 years ago)
Author:
bas
Message:

text/plain attachments are not attached when they are marked as not inline, see #270

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/email2trac.py.in

    r564 r569  
    19181918                continue
    19191919           
    1920             ## Check if this is an inline part. It's inline if there is co Cont-Disp header, or if there is one and it says "inline"
     1920            ## Check if this is an inline part. It's inline if there is co Cont-Disp header,
     1921            #  or if there is one and it says "inline"
    19211922            #
    19221923            inline = self.inline_part(part)
     
    19311932                    continue
    19321933
     1934            filename = part.get_filename()
     1935            s = '\t unicode filename: %s' %(filename)
     1936            self.print_unicode(s)
     1937            self.logger.debug('\t raw filename: %s' %repr(filename))
     1938
     1939            filename = self.check_filename_length(filename)
    19331940
    19341941            ## Save all non plain text message as attachment
     
    19361943            if not content_type in ['text/plain']:
    19371944
    1938                 filename = part.get_filename()
    1939                
    1940                 s = '\t unicode filename: %s' %(filename)
    1941                 self.print_unicode(s)
    1942                 self.logger.debug('\t raw filename: %s' %repr(filename))
    1943 
    1944                 # 11 Aug 2011 -> Obsolete code
    1945                 ## First try to use email header function to convert filename.
    1946                 #  If this fails the use the plain filename
    1947                 #
    1948                 #name = part.get_filename()
    1949                 #try:
    1950                 #    print repr(name), len(name)
    1951                 #    filename = self.email_to_unicode(part.get_filename())
    1952                 #    print "Bas: ", repr(filename), len(filename)
    1953                 #except UnicodeEncodeError, detail:
    1954                 #    print "Bas", repr(detail)
    1955                 #    filename = part.get_filename()
    1956 
    1957                 message_parts.append( (self.check_filename_length(filename), part) )
    1958 
    1959                 ## We van only convert html messages
     1945                message_parts.append( (filename, part) )
     1946
     1947                ## We only convert html messages
    19601948                #
    19611949                if not content_type == 'text/html':
    1962                     self.logger.debug('\t Appending content_type = %s' %(content_type))
     1950                    self.logger.debug('\t Appending %s (%s)' %(repr(filename), content_type))
    19631951                    continue
    19641952
     1953
     1954            ## We have an text or html message
     1955            #
    19651956            if not inline:
    1966                     self.logger.debug('\t Skipping %s, not an inline messsage part' %(content_type))
     1957                    self.logger.debug('\t Appending %s (%s), not an inline messsage part' %(repr(filename), content_type))
     1958                    message_parts.append( (filename, part) )
    19671959                    continue
    19681960               
     
    22712263    notification.
    22722264    """
     2265    #print sender_email, resid
    22732266    (torcpts, ccrcpts) = self.get_recipients(resid)
    2274 
    2275     print torcpts, ccrcpts, sender_email
     2267    #print "get_recipients finished"
    22762268
    22772269    if not tktparser.email_header_acl('notify_reporter_black_list', sender_email, False):
Note: See TracChangeset for help on using the changeset viewer.