omnibrain 20 Posted June 20 Hi, we run into the problem, that when receiving mails some attachments don't show up. We use SslPop3Client.OnMessageLine to read all line, add them to a TStringlist, put that into a memoryStream and then do mimeDecode.DecodeStreamEx(mailStream). This works, except for one customer. Analysing the "raw" mail, I can see that the name for the attachment part is encoded. ----boundary_51655_e3dbec97-f69f-48f1-b41b-3f7293127257 Content-Type: application/pdf; name="=?utf-8?B?VGFXYSBmw7xyIEhHLVNWIDM1MiB2b20gMjAuMDYuMjAyNSAwOV80OV8w?= =?utf-8?B?OC5wZGY=?=" Content-Transfer-Encoding: base64 Content-Disposition: attachment JVBERi0xLjUNCjQgMCBvYmoNCjw8L1R5cGUgL1BhZ2UvUGFyZW50IDMgMCBSL0NvbnRlbnRzIDUg ........... If there is "clear text" in the name part it works, with this encoded text it doesn't work. Do you have any idea what's going wrong? Share this post Link to post
Angus Robertson 652 Posted June 20 The TMimeDecodeW.PartNameW property should decode the inline MIME correctly, although PartName should have returned the encoded version. This is because the unit was written in AnsiString times, and unicode added later to the W . It's possibly due for rewrite to remove AnsiStrings. However I'm not sure about the quotes around the name, I don't think we expect them for inline MIME. I can not test your MIME because DelphiPraxis has corrupted what appears to be fixed text with hidden unicode characters that can not be pasted into Delphi, or easily removed, so our MimeDemo sample is unable to decode your name value. Angus Share this post Link to post
omnibrain 20 Posted June 20 Thanks for having a look. I did not find the "raw string", that's why I copied what a regular mail client (emClient) presented as source code of the mail, when I used it to receive the mail. (emClient could decode the file name). It looks exactly like it's shown in the forum. quotes and question marks included. I did not know about PartName/PartNameW, I will check this, but sadly earliest on wednesday. I will also try to extract the string name from the raw MessageLine. Share this post Link to post
Angus Robertson 652 Posted June 20 Decoding just the inline MIME file name does work: Unicode Header: TaWa für HG-SV 352 vom 20.06.2025 09_49_08.pdf [CharSet=utf-8] The forum problem is extra stuff being added: n\n\n\n\t\u00a0\n\n\n\n----boundary_51 Angus Share this post Link to post