Diffs not displayed inline in Gmail
Bug #401772 reported by
Aaron Bentley
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Low
|
Unassigned |
Bug Description
Diffs are not displayed inline by Gmail. It has been suggested that their encoding was the cause, but we have changed the encoding from base64 to quoted-printable, and they are still not displayed inline. Since Gmail will happily display text attachments that are in quoted-printable, it appears that, contrary to suggestions, the encoding was not to blame.
The Content-type and (lack of) its charset parameter are the most likely culprits. The charset cannot reasonably be supplied, because multiple encodings may be used for the files in a given diff. It's also possible that supplying a filename in the content-disposition causes this.
Related branches
lp:~abentley/launchpad/gmail-inline
Merged
into
lp:launchpad
- Edwin Grubbs (community): Approve
- Diff: None lines
Changed in launchpad-code: | |
status: | Triaged → Fix Released |
To post a comment you must log in.
Investigation suggests that Gmail uses the filename and content-type to determine whether to display the attachment inline.
If the file extension is '.txt', or the content-type is 'text/plain', the message is displayed inline. (It's not known which extensions are acceptable, but .patch and .diff have been determined unacceptable.)
We could override the content-type or file extension for gmail.com addresses, but that would not reach all gmail users, because some people use gmail to read mail for other domains.
If we try to use one message type for both gmail and conforming clients, it seems best to retain the content-type, since conforming clients will respect it, and set the filename such that it pleases gmail.
Finally, even when patches are displayed inline, they are displayed in a variable-width font, so they are not very readable. However, Gmail provides a "View" link that displays them in a fixed-width font.