apple / ccs-calendarserver

The Calendar and Contacts Server.
https://www.calendarserver.org
Apache License 2.0
486 stars 136 forks source link

Mails broken if /accounts/user/name contains umlauts #321

Closed macosforgebot closed 13 years ago

macosforgebot commented 13 years ago

mail@… originally submitted this as ticket:413


Hi,

I have an Umlaut in my name: ö.

The mailgateway will send mails like the following:

2011-02-07 09:50:08+0100 [-] [mailgateway]    From: =?utf-8?q?Felix_M=C3=B6ller_=3Cmail=40felixmoeller=2Ede=3E?=

Removing the Umlaut it gets back to:

2011-02-07 10:01:06+0100 [-] [mailgateway]    From: Felix Moeller <mail@felixmoeller.de>

I guess this should allready be encoded in Quoted Printable at:

            formattedFrom = "%s <%s>" % (cn, fromAddr)

Workarround is to remove the Umlaut...

macosforgebot commented 13 years ago

@cyrusdaboo originally submitted this as comment:1:⁠ticket:413


The ?q? encoding piece should only be applied to the "comment" portion of the From address and not the mailbox portion. i.e. it ought to have been:

From: =?utf-8?q?Felix_M=C3=B6ller?= <mail@…>

macosforgebot commented 13 years ago

mail@… originally submitted this as comment:2:⁠ticket:413


With current head it sends a mail out like this:

2011-07-13 07:05:25+0200 [-] [mailgateway]     From: Felix Möller <mail@felixmoeller.de>

Is this valid? I often read on the internet that headers must be encoded in 7/8 bits no matter what the characterset of the mail is.

Whats about http://tools.ietf.org/html/rfc2047 ?

macosforgebot commented 13 years ago

@m0rgen originally submitted this as comment:3:⁠ticket:413


Correct, the From needs to be encoded (the Subject already was being properly encoded), fixed in https://trac.calendarserver.org/changeset/7784/CalendarServer/trunk