Skip to content
This repository has been archived by the owner on Feb 13, 2020. It is now read-only.

[PATCH] RFC5545 section 3.2.3 CUTYPE may not be set #325

Closed
macosforgebot opened this issue Feb 18, 2011 · 2 comments
Closed

[PATCH] RFC5545 section 3.2.3 CUTYPE may not be set #325

macosforgebot opened this issue Feb 18, 2011 · 2 comments

Comments

@macosforgebot
Copy link

mail@… originally submitted this as ticket:417


Creating events with Thunderbird the attendees were missing in the invitation mail.

Looking at the events the following difference can be seen: iOS:

ATTENDEE;CN=felix@derklecks.de;CUTYPE=INDIVIDUAL;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:mailto:felix@example.com

Lightning:

ATTENDEE;PARTSTAT=NEEDS-ACTION;ROLE=REQ-PARTICIPANT;RSVP=TRUE:mailto:felix@example.com

in mail.py the following is done:

      for attendeeProp in calendar.getAllAttendeeProperties():
            params = attendeeProp.params()
            cutype = params.get('CUTYPE', (None,))[0]
            if cutype == "INDIVIDUAL" :
                cn = params.get("CN", (None,))[0]
                cuaddr = normalizeCUAddr(attendeeProp.value())
                if cuaddr.startswith("mailto:"):
                    mailto = cuaddr[7:]
                    if not cn:
                        cn = mailto
                else:
                    emailAddress = params.get("EMAIL", (None,))[0]
                    if emailAddress:
                        mailto = emailAddress
                    else:
                        mailto = None

                if cn or mailto:
                    attendees.append( (cn, mailto) )

But reading RFC5545 there is the following:

   Description:  This parameter can be specified on properties with a
      CAL-ADDRESS value type.  The parameter identifies the type of
      calendar user specified by the property.  If not specified on a
      property that allows this parameter, the default is INDIVIDUAL.
      Applications MUST treat x-name and iana-token values they don't
      recognize the same way as they would the UNKNOWN value.

Therefore the following patch should be applied:

Index: twistedcaldav/mail.py
===================================================================
--- twistedcaldav/mail.py       (Revision 7047)
+++ twistedcaldav/mail.py       (Arbeitskopie)
@@ -835,7 +835,7 @@
         for attendeeProp in calendar.getAllAttendeeProperties():
             params = attendeeProp.params()
             cutype = params.get('CUTYPE', (None,))[0]
-            if cutype == "INDIVIDUAL":
+            if cutype == "INDIVIDUAL" or cutype is None :
                 cn = params.get("CN", (None,))[0]
                 cuaddr = normalizeCUAddr(attendeeProp.value())
                 if cuaddr.startswith("mailto:"):
@macosforgebot
Copy link
Author

mail@… originally submitted this as comment:1:⁠ticket:417


Needs to be udpated for current trunk:

See http://trac.calendarserver.org/ticket/417
and http://tools.ietf.org/html/rfc5545#section-3.2.3

Index: twistedcaldav/mail.py
===================================================================
--- twistedcaldav/mail.py        (Revision 7700)
+++ twistedcaldav/mail.py        (Arbeitskopie)
@@ -834,7 +834,7 @@
         attendees = []
         for attendeeProp in calendar.getAllAttendeeProperties():
             cutype = attendeeProp.parameterValue('CUTYPE', None)
-            if cutype == "INDIVIDUAL":
+            if cutype == "INDIVIDUAL" or cutype is None :
                 cn = attendeeProp.parameterValue("CN", None).decode("utf-8")
                 cuaddr = normalizeCUAddr(attendeeProp.value())
                 if cuaddr.startswith("mailto:"):

@macosforgebot
Copy link
Author

@m0rgen originally submitted this as comment:2:⁠ticket:417

  • Status changed from new to closed
  • Resolution changed from to Software changed

Fixed in https://trac.calendarserver.org/changeset/7703/CalendarServer/trunk

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants