gen-smtp / gen_smtp

The extensible Erlang SMTP client and server library.
Other
683 stars 265 forks source link

UTF-8 header values should be escaped using RFC 2047 #28

Closed arjan closed 11 years ago

arjan commented 12 years ago

Although most mail clients display utf-8 encoded subject lines / recipients fine, some do not (e.g. Apple Mail). Therefore those values should be escaped using rfc2047.

http://en.wikipedia.org/wiki/MIME#Encoded-Word

mworrell commented 12 years ago

Special care should be taken with UTF-8 names in recipient headers. As those names should be escaped, but not the e-mail addresses.

mworrell commented 12 years ago

Example:

To: =?UTF-8?Q?Fr=C3=A6derik=20H=C3=B8lljen?= <fh@ez.no>

arjan commented 12 years ago

Where we could get the test cases from: http://svn.apache.org/repos/asf/incubator/zetacomponents/stable/Mail/1.2/tests/mail_test.php

see testHeadersWithCharsetUtf8