[CalendarServer-changes] [7784] CalendarServer/trunk/twistedcaldav

source_changes at macosforge.org source_changes at macosforge.org
Wed Jul 13 11:32:40 PDT 2011


Revision: 7784
          http://trac.macosforge.org/projects/calendarserver/changeset/7784
Author:   sagen at apple.com
Date:     2011-07-13 11:32:39 -0700 (Wed, 13 Jul 2011)
Log Message:
-----------
Handle non-ASCII From address in IMIP

Modified Paths:
--------------
    CalendarServer/trunk/twistedcaldav/mail.py
    CalendarServer/trunk/twistedcaldav/test/test_mail.py

Modified: CalendarServer/trunk/twistedcaldav/mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/mail.py	2011-07-13 17:28:53 UTC (rev 7783)
+++ CalendarServer/trunk/twistedcaldav/mail.py	2011-07-13 18:32:39 UTC (rev 7784)
@@ -933,10 +933,14 @@
                 orgEmail = None
             cn = calendar.getOrganizerProperty().parameterValue('CN', None)
             if cn is None:
-                cn = 'Calendar Server'
+                cn = u'Calendar Server'
                 orgCN = orgEmail
             else:
-                orgCN = cn.decode("utf-8")
+                orgCN = cn = cn.decode("utf-8")
+
+            # a unicode cn (rather than an encode string value) means the
+            # from address will get properly encoded per rfc2047 within the
+            # MIMEMultipart in generateEmail
             formattedFrom = "%s <%s>" % (cn, fromAddr)
 
             # Reply-to address will be the server+token address

Modified: CalendarServer/trunk/twistedcaldav/test/test_mail.py
===================================================================
--- CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-07-13 17:28:53 UTC (rev 7783)
+++ CalendarServer/trunk/twistedcaldav/test/test_mail.py	2011-07-13 18:32:39 UTC (rev 7784)
@@ -292,7 +292,7 @@
                     (u'An Attendee without CUTYPE', u'nocutype at example.com'),
                     (None, u'nocn at example.com'),
                 ],
-                "Th\xc3\xa9 Organizer <organizer at example.com>",
+                u"Th\xe9 Organizer <organizer at example.com>",
                 "attendee at example.com",
             ),
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20110713/596e249a/attachment.html>


More information about the calendarserver-changes mailing list