View Single Post
Old 5 Oct 2021, 07:32 AM   #4
JeremyNicoll
Essential Contributor
 
Join Date: Dec 2017
Location: Scotland
Posts: 484
Quote:
Originally Posted by filbert View Post
There’s a save feature that saves an eml file but it’s still broken when I open it in, eg, Mail.

There’s a screenshot here
The lower half of the screenshot looks to be exactly like you'd expect the html (rich text) part of an email to look like if you viewed it in a text editor - ie normal html.

The upper part of the screenshot - with no Subject or From information for a whole set of emails either implies that the mails concerned don't have Subject and From: headers in them, or that they do but TB failed to spot them.

If you take one of the .eml files you mentioned and rename it to .txt and open it in your text editor (or Notepad if you don't have a better one) does it start with all the normal headers? If you don't know what normal looks like, try exporting a mail that TB displays properly and look at it.

Normally an email contains a set of headers, with no blank lines between them, then a blank line, then content. In the initial headers there should be one named "Content-Type:" which will say whether the mail contains only plain text, or only something else, or multiple parts (and if that, how they are delimited further on).

What you're seeing might be caused by some or all of the expected initial headers not being present at all, or them - especially Content-Type: not matching the format of what follows.

I've seen this sort of thing happen with email clients which receive a whole set of emails in one stream (or file) and have, as they read through that, to work out where each individual email starts and stops. If eg in one of your .eml files you see html contents followed by headers, that might imply that TB has at some point seen a stream of emails and got confused about where each one starts and stops. But if it's reading each one separately from an IMAP server I don't think I'd expect that to happen. The fact that you can view these mails properly via webmail suggests they're ok on the server(s).

If your problem was just that the display half of the screen showed html, but the Subject & From were set in the upper half, I'd suspect malformed mails, eg ones with no Content-Type, or one that says what follows is plain text even though that text is HTML.

It's increasingly common for emails from large companies either to have no plain text part, or one that's out of sync with the html part. Sometimes some webmail systems, if you set them only to show the plain text part, will show not the plain text (if there is one) that's in the mail itself, but instead make a copy of the html part and strip out the html markup. I suppose it's just possible that your mails actually do contain html markup in their supposed plain text part ... but that wouldn't explain the missing header info.

Do the bad emails all come from one particular person / company?
JeremyNicoll is offline   Reply With Quote