Merge ubuntu-dev-tools:import-bug-fix into ubuntu-dev-tools:master
Proposed by
Brian Murray
Status: | Needs review |
---|---|
Proposed branch: | ubuntu-dev-tools:import-bug-fix |
Merge into: | ubuntu-dev-tools:master |
Diff against target: |
31 lines (+9/-0) 2 files modified
debian/changelog (+5/-0) import-bug-from-debian (+4/-0) |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Mattia Rizzolo | Needs Fixing | ||
Review via email: mp+406679@code.launchpad.net |
Description of the change
The tool import-
like the following:
[<email.
<email.
I believe this is because the first message has multiple payloads and
import-
wrong please see:
http://
I've been using this successfully for almost a year now.
To post a comment you must log in.
Right, I think your analysis is correct.
However I think a more formally appropriate fix would be to iterate through the payloads (in case of a multipart message), gather all the inline pieces of text/plain, concatenate them and use the resulting string. Mails with multiple inline text/plain parts are incredibly rare, but I've seen submitters of Debian bugs doing that to interleave descriptions to attachments.
See an example here: https:/ /bugs.debian. org/981577
Anyway, rather than that `if isinstance()` check, you should be using .is_multipart(), followed by checking with .get_content_type() to verify it's really text/plain.
Everything while looping through .walk().
At the very very least, I'd rather the code gave up if it detected a too complex mail, erroring out saying so.