Opened 12 years ago

Closed 12 years ago

#105 closed enhancement (fixed)

Better support for inline attachments and multiple body parts

Reported by: anonymous Owned by: bas
Priority: major Milestone:
Component: email2trac Version: 0.4
Keywords: Cc: ben@…


Right now, email2trac assumes that the first text part of a message is its body, and that everything else is an attachment.

With modern email clients, it's possible to create a message that has an attachment in the middle of its body. MIME represents this kind of a thing as a text/plain part followed by an image type followed by another text/plain part.

When this happens, email2trac produces a ticket whose description contains only the first part of the body, and gives it two attachments: one for the image, and one for the second part of the body. This is wrong.

The patch that I am attaching implements the following features

Proper support for multiple body parts

If a message's body is broken up into several pieces (by attachments in the middle of the message), the ticket's description is set to the entire body, not just the first part

For example, from an email like this:

some text
<some image>
more text

the ticket that is created will have "some text" and "more text" in its description

Links to attachments inside the ticket description

[attachment:filename] links are automatically placed inside the ticket description, so that message text can clearly refer to them.

For example, an email like

I opened this file in your app:
<my file>
and I got the following error dialog:

will generate a ticket like this:

I opened this file in your app:

[attachment:"my file"]

and I got the following error dialog:


Inline image attachments

If an attachment is of type image/* and its Content-Disposition is inline, then a Trac Image macro is placed inside the ticket description in the appropriate place, so that the resulting ticket has the image inline where it belongs in the text.

The same email as in the previous example, if the image is inline, will result in:

I opened this file in your app

[attachment:"my file"]

and I got the following error dialog:


Attachments (1)

inline-attachments.diff (12.1 KB) - added by ben@… 12 years ago.

Download all attachments as: .zip

Change History (7)

Changed 12 years ago by ben@…

comment:1 Changed 12 years ago by bas

  • Cc ben@… added
  • Status changed from new to assigned

Ben Thanks a lot of this enhancement. You have have add a lot new features to email2trac . I can give you write access to the repository so you can apply your patches and enhancements directly if you want.

comment:2 Changed 12 years ago by ben@…

That would be quite nice, thanks

comment:3 follow-up: Changed 12 years ago by bas

Ok i will create a username for you. what is your preferred loginname? I have to have some information from you for our CUA (Central User Administration):

  • First name
  • Surname

I am on vacation to build a bouse till 3 january, but i can stiil create accounts.

comment:4 in reply to: ↑ 3 Changed 12 years ago by ben@…

I'm Ben Artin, preferred username is bromine.

comment:5 Changed 12 years ago by bas

Account is created. You can apply your patches. Good luck and thanks again for the improvements.

comment:6 Changed 12 years ago by bromine

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

Applied to trunk -- changeset:236

Add Comment

Modify Ticket

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

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

Note: See TracTickets for help on using tickets.