Kieran - 2023-04-12 13:36:15
I believe there is a bug in the phpclasses mimeparser where a rogue carriage return / line feed is added to the end of every decoded body. It comes from the mime structure, but shouldn't be present in the decoded body. For example:
Failed asserting that two strings are identical.
Expected :'"Dear,"'
Actual :'"Dear,\n"'
Failed asserting that two strings are identical.
Expected :'"<html><body>Dear,<\/body><\/html>"'
Actual :'"<html><body>Dear,<\/body><\/html>\n"'
Failed asserting that two strings are identical.
Expected :'"9801855875A5D50DE372AA3C469C1B8C8933B70E2B8612EE90B4F7DF8290CDDABB8DA560970F185A37459CD13BC9B89B64F87D45ADEAD235509ABD5DC0ADD"'
Actual :'"9801855875A5D50DE372AA3C469C1B8C8933B70E2B8612EE90B4F7DF8290CDDABB8DA560970F185A37459CD13BC9B89B64F87D45ADEAD235509ABD5DC0ADD\n"'
In each case you can see a trailing \n which is part of the mime structure is being added to the decoded body. It's not really a concern for text, but for attachments it changes the number of expected bytes in the file.
@Manuel I've emailed you a test case.