Having done a bit more delving it seems the Samsung mail app encodes a plain text and an HTML part, each coded in base64. I’ve found if I add a blank line between the two encodings then the mail filter works correctly. It may be Samsung is not adding a blank line where it should, or it may be the mail filter isn’t correctly locating the plain text/HTML text part and not realising that once it’s found the HTML part it knows where the header of that finishes and the message content starts.
I’ve tried copying the original e-mail from Gmail (via view original) and also exporting the same message from Thunderbird, with the same results.
Samsung-generated e-mails seem to have this at the bottom of the headers:
Content-Type: multipart/alternative;
boundary="--_com.samsung.android.email_396413402758380"
----_com.samsung.android.email_396413402758380
Content-Transfer-Encoding: base64
Content-Type: text/plain; charset=UTF-8
WWVz[base64 encoded plain text message goes here]
and this ends with
[more base64 encoded data here]19fDQo=
----_com.samsung.android.email_396413402758380
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=UTF-8
PGh0b[base64 encoding again, this time encoding HTML version of the same message]
and this ends with
[more base64 encoded data]NCg==
----_com.samsung.android.email_396413402758380--
Now if I change the middle bit by adding a blank line (after the “email_396413402758380” bit), all works perfectly!
[more base64 encoded data here]19fDQo=
----_com.samsung.android.email_396413402758380
Content-Transfer-Encoding: base64
Content-Type: text/html; charset=UTF-8
PGh0b[base64 encoding again, this time encoding HTML version of the same message]
Does this suggest a bug in the importer?