Open Bug 1130592 Opened 11 years ago Updated 10 years ago

email_in treats html alternative as an attachment

Categories

(Bugzilla :: Incoming Email, defect)

defect
Not set
normal

Tracking

()

ASSIGNED

People

(Reporter: altlist, Assigned: altlist)

Details

Attachments

(2 files)

Attached patch v1 — — Splinter Review
When replying to a bugzilla ticket via email (from outlook), the response includes both a plain text and html version. email_in treats the html version as an attachment, whereas it should be dropped. This is because email_in treats alternative text as an attachment. Could someone explain why? The attached patch "solves" my particular situation.
The answer is in email_in.pl itself: # Get the first part of the email that contains a text body, # and make all the other pieces into attachments. (This handles # people or MUAs who accidentally attach text files as an "inline" # attachment.)
Assignee: create-and-change → incoming.email
Component: Creating/Changing Bugs → Incoming Email
Yes, I saw that. But I don't understand the reasoning to treat alternative text bodies as attachments. Seems like the code should just pick one, and drop the rest.
Attachment #8560696 - Attachment is patch: true
Attachment #8560696 - Attachment mime type: text/x-patch → text/plain
Attachment #8560696 - Flags: review?(dylan)
As said in comment 1, if your patch or attachment is included inline, then it would be lost.
Hi Frederic, I think there's a disconnect here. When I reply to a bugzilla email via Outlook, it is Outlook itself that includes both a plain-text and html-based version of the email response. I'm not inlining nor attaching. Bugzilla however, assumes the alternate version of the response is an attachment, when instead, it should just drop the alternate version.
(In reply to Albert Ting from comment #4) > Bugzilla however, assumes the alternate version of the response is an > attachment, when instead, it should just drop the alternate version. Assuming you have a real inline attachment and an HTML version of the text, is there a way to distinguish them? I don't use Outlook myself.
The content-type does say multipart/alternative, something like below: > Content-Type: multipart/alternative; > boundary="_ABC_" > > --_ABC_ > Content-Type: text/plain; charset="utf-8" > Content-Transfer-Encoding: base64 > > <encoded text> > > --_ABC_ > Content-Type: text/html; charset="utf-8" > Content-Transfer-Encoding: base64 > > <encoded text> > > --_ABC_ And if one adds a real attachment, the main content type will be multipart/mixed, with the first block containing the above embedded multipart/alternative block
Assignee: incoming.email → altlist
Status: NEW → ASSIGNED
Comment on attachment 8560696 [details] [diff] [review] v1 Can you attach a full email with the structure of comment 6? The code in email_in.pl seems correct. If it detects a multipart/alternative header, it extracts the text/plain part and discard the text/html one. So the text/html part is never included as attachment.
Attachment #8560696 - Flags: review?(dylan) → review-
Attached file Sample html_response —
Hi Frederick, see sample html_response file. I stripped out various email headers to keep it simple.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: