marlam / msmtp

SMTP client with sendmail compatible interface
https://marlam.de/msmtp
GNU General Public License v3.0
176 stars 36 forks source link

Encoding of from_full_name #162

Closed Rutherther closed 2 months ago

Rutherther commented 2 months ago

Hi,

I wanted to use from_full_name along with set_from_header on. Since my name contains some czech characters, I put them in the full name. These can be áéíóúžščřěů. The e-mails I sent were displaying with wrong characters in name in other clients that eventually received them via IMAP. I am not completely sure if this is problem of msmtp or opensmtpd that was likely trying to translate these to smtputf8 - in K-9 mail on Android I see the sender as =?utf-8?B?...=?=`.

I've tried playing locally with what msmtp produces and observed it just puts in the characters as is, whereas if I try other client, like Emacs, that one will put in smtp utf8 string instead of the raw characters. With that, I am able to receive the mail properly in other clients.

I've solved this by copying =?utf-8?B?...=?= that was produced by other e-mail client using my full name. Should msmtp also support conversion to smtp utf8, or is it expected users will put this string in their configuration instead?

marlam commented 2 months ago

Hi, you are right, msmtp should properly encode non-ASCII content in the From header.

I will implement that as soon as I find the time. The solution will probably use base64 (?B?) instead of quoted-printable, same as in your example, since msmtp already has base64 code.

Rutherther commented 2 months ago

Confirming this works. Thanks.

mlt commented 1 month ago

The fix breaks Windows builds including msys2 as there is no langinfo.h and nl_langinfo(). There is PlibC implementation. I'm not sure if it is a good idea to pull it.

marlam commented 1 month ago

Should be fixed by this commit.