Allow messages with no text or HTML body and no attachments. - #247
Allow messages with no text or HTML body and no attachments.#247iamamoose wants to merge 1 commit into
Conversation
…re fairly common for example a calendar entry might be sent as "Content-Type: text/calendar". I just made it so that if there is no recognised body it just uses whatever the last section it found was, regardless of content type.
|
Trying to import the attached file without this patch: $ pipenv run ./import-mbox.py --source /tmp/mjc11a-sanitised.mbox.txt --html2text --lid mark@awe.com --dry with it, and setting the config option $ pipenv run ./import-mbox.py --source /tmp/mjc11a-sanitised.mbox.txt --html2text --lid mark@awe.com --dry |
| elif ( | ||
| body is None | ||
| ): | ||
| last_random = Body(part) |
There was a problem hiding this comment.
If allow_nontext_body is not set, then last_random is not needed, and should not be calculated
These are fairly common for example a calendar entry might be sent as "Content-Type: text/calendar". I just made it so that if there is no recognised body it just uses whatever the last section it found was, regardless of content type.
Example:
mjc11a-sanitised.mbox.txt