Modify

Opened 12 years ago

Closed 12 years ago

#270 closed defect (fixed)

Attachments of type "Text/Plain" are not attached if more than one attachment is sent

Reported by: hju@… Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 2.4.0
Keywords: Cc:

Description

I'm facing a strange effect with attachments.

We use blat 2.6.2 to send logfiles from batchjobs using the "-attach" parameter. If there is only one file "file1.txt", this file of type "TEXT/PLAIN" is attached and processed fine with email2trac (means: attached to a new ticket)

I've extended the processing to send three attachments:

  • file1.txt
  • file2.txt
  • file3.dimport

All files are simple text-files

In this case, file3 is of type "APPLICATION/OCTET-STREAM" (depends on extension, i guess). Only file3.dimport is attached. The other files are ignored (no warning or error).

I changed the blat parameter to "-attacht" to attach the logs as Text-Attachments. The mail-attachments are now all of type "TEXT/PLAIN", but nothing is attached by email2trac (no warning or error)

Looking at the code, it themes clear because this attachments are explicitly excluded in def get_message_parts(self, msg):

    def get_message_parts(self, msg):
    ...
        for part in msg.walk():
            ...
            ## Save all non plain text message as attachment
            #
            if not content_type in ['text/plain']:

Strange that a single TEXT/PLAIN attachment is processed by email2trac...

Maybe it's a solution to remove this restriction, but I think this is not restricted without reason. In older versions of email2trac, this part was handled different...

Attachments (0)

Change History (7)

comment:1 Changed 12 years ago by bas

  • Status changed from new to assigned

text/plain files are handled differently. There are not attached. The text is put into the ticket, see:

  • body_text = self.get_body_text(message_parts)

I will do some tests tomorrow with multiple text/plain attachments.

comment:2 Changed 12 years ago by hju@…

There are not attached. The text is put into the ticket, see:

Just for clearification. If I send the txt-files as "Inline-Attachment" (-attachi parameter of blat) they are include in the ticket description.

But this is not what I want with a log-file of a 600kb and some thousand lines...

comment:3 Changed 12 years ago by bas

Just a question can you attach a raw email message with multiple text/plain attachment. So i can do some tests? Thanks for the clarification

comment:4 follow-up: Changed 12 years ago by hju@…

I've send two mails (to basv@...) via blat. One with the files attached as binaries and the other with the files attached as text.

comment:5 Changed 12 years ago by bas

(In [569]) text/plain attachments are not attached when they are marked as not inline, see #270

comment:6 in reply to: ↑ 4 Changed 12 years ago by bas

Replying to hju@…:

I've send two mails (to basv@...) via blat. One with the files attached as binaries and the other with the files attached as text.

Thanks for the emails. I just found the problem and committed a fix.

comment:7 Changed 12 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

fixed in version 2.4.2

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.