Attachments are not reaching rambler mail correctly

In general, I am trying to send an email from my internal work mail via an SMTP client to a mailbox that is located in rambler. I attach a *to this attachment.xlsx file with the name in Cyrillic.

The problem is that in the email attachment, it is displayed as 2. bin, although it comes to other mailers correctly. The file does not deteriorate when you send it, because if you rename it, it opens correctly through Excel.

If you change the name to Latin, then the problem disappears... However, I do not understand what is the reason for this transformation of the name... If there were problems with the encoding, then the name would be displayed by some krakozyabra.

Maybe someone has faced a similar problem?

I send the email via C# code, where I use the MailKit lib,

Author: iluxa1810, 2020-09-25

1 answers

In general, I conducted various experiments and found that if you forward the same email from Outlook, it correctly reaches the rambler.

It turned out that the problem is in this header:

Content-Disposition: attachment; filename= "=?utf-8?B?0KHQstC+0LTQvdGL0Lkg0L7RgtGH0LXRgiDQt9CwINCh0LXQvdGC0Y/QsdGA?= =?utf-8?B?0YwueGxzeA==?="; size=379865;

You need to encode the file name in Base64 and specify the encoding and then it normally comes.

By the way, Outlook performs alignment and transfers part of the file name to another line(multiple utf-8 references for one chunk and for another).

If you send from rambler to rambler, it uses a different encoding:

Content-Disposition: attachment; filename="=?koi8-r?B?89fPxM7ZyiDP1N7F1CDawSDzxc7U0cLS2C54bHN4?="

But UTF-8 digests too.

MailKit ' s sent here so:

Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet; name0=utf-8''%D0%A1%D0%B2%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9%20%D0%BE%D1%82; name1=%D1%87%D0%B5%D1%82%20%D0%B7%D0%B0%20%D0%A1%D0%B5%D0%BD%D1%82%D1%8F; name2=%D0%B1%D1%80%D1%8C.xlsx; charset=utf-8 Content-Disposition: attachment; filename0=utf-8''%D0%A1%D0%B2%D0%BE%D0%B4%D0%BD%D1%8B%D0%B9%20%D0%BE%D1%82; filename1=%D1%87%D0%B5%D1%82%20%D0%B7%D0%B0%20%D0%A1%D0%B5%D0%BD%D1%82; filename2=%D1%8F%D0%B1%D1%80%D1%8C.xlsx

It's probably some standard that Rambler didn't understand...

 2
Author: iluxa1810, 2020-09-28 12:31:26