iCalendar does not create an event for organizer

为君一笑 提交于 2019-11-28 08:21:49

Let’s say that organizer want to create an meeting for 2 attendees. He fills in a form in the booking system. The booking system sends email containing iCalendar standard to himself and to 2 meeting attendees.

This scenario doesn’t work.

It is not possible to create an event (cancellable meeting object) in the calendar of the organizer. The client thinks that email containing iCalendar format is just notification for attendee of the meeting already created in the organizer calendar. If such an email arrives to organizer’s mailbox, client app doesn’t create an event in the organizer’s calendar. It assumes that an event was created by organizer himself. E.g.: Outlook tells you in that case that “Meeting cannot be found in the calendar”.

If you ask Microsoft support about it, they only tell you that they does not support open standards: http://support.microsoft.com/kb/2269506

Working solution to this problem is to use platform services (Exchange Web Services or Google Calendar API) to create an event in the organizer’s calendar. Forget iCalendar standard. The services can be configured for sending notifications to attendees automatically. So it is enough to pass “SendInvitationsMode.SendToAllAndSaveCopy” if you’re using EWS:

Appointment appointment = new Appointment(service);
appointment.Subject = "Status Meeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2014, 3, 1, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("user1@contoso.com");
appointment.RequiredAttendees.Add("user2@contoso.com");
appointment.OptionalAttendees.Add("user3@contoso.com");  
appointment.Save(SendInvitationsMode.SendToAllAndSaveCopy);

or set “sendNotifications” parameter to true in case of Google Calendar API.

You don’t need to send an email to every particular attendee.

This is a bit of an old issue, but i think it is caused from using METHOD:REQUEST This marks that the ical should be updated, not that it is a new item. Instead, use METHOD:PUBLISH

I can confirm that this works with DDay.iCal and Outlook Calendars.

This drove me mad for a week, so it is nice to see someone else confirming what I suspected. There is actually a relatively simple solution, which solves the question, although it is not very elegant. I can understand why one would not be allowed to take the role of Organiser from an outside source, but it is annoying that you can't.

Send out 2 invites. One to yourself (or whoever the organiser is) and then a different one to everyone else.

The one to yourself should have something else other than you down as the ORGANSISER, e.g. ORGANIZER:donotreply@outlook.com

The one to everyone else should have your email down as the organizer.

For this approach to work, you should set METHOD:REQUEST. If you set it to PUBLISH you will get duplicates on updates.

This approach means you get the meeting in your diary and you also get replies (to get replies you need to include the following line for each attendee: ATTENDEE;CN="The Name";RSVP=TRUE:mailto:the_email@address.com.)

Note that the UID is the same for both versions of the file. It helps if the ORGANISER gets the Invite first so they can accept it before they start getting replies, otherwise people will be replying to something that effectively does not yet exist. That wont stop them accepting the invite, but it might be a little confusing for the ORGANIZER. To help with this I put in a slight delay between email 1 and 2.

I would assume that your problem is because Exchange assumes that the organizer of the event is also the originator of the event. Which seems fair enough, as otherwise it would be child's play to send meetings to people making them the organizer and they would be added automatically to the person's calendar.

All that said, no idea how to get around the issue.

the behavior of event invitation being sent by email is described in rfc6047 which further extends the icalendar RFC (RFC5545).

section 2 and section 3 on security, summarizes two spoofing threats:

spoofing the "Organizer", and spoofing an "Attendee"

that is

spoof@xyz.example.net is not allowed to modify or cancel a meeting that was organized by a@example.com.

to your case: 1. did you send the invitation from the same email address as your exchange (talking about the From: in the mail not the Organizer:mailto ? if not it might be worth trying to send it via the exchange address. 2. should above not work, to address your need for the organizer to have the invitation in its calendar you probably will need to add it programmatically in the organizer's agenda as it is likely that the CUA (Calendar User Agent) or Exchange does not allow a 3rd party mailer to add events in agenda without end-user UI usage.

In recent months ,our service also meet the same problem as you: our service create meeting calendar for organizer and attendees, if attendees contains organizer ,organizer (as a atteendee) can get a calendar email, but it does neither be allowed to receive/reject the meeting(the button is disabled) nor see it in calendar(no calendar event).

finally, I notice that only when under following condition this will happen: 1. mail.From = organizer 2. Ateendees.contains(organizer) //case-insensitive.

So , I simply change my code to follwing , and it works fine for all attendees (include organizer):

if (!attendeeEmail.ToLower().Contains(organizer.Address.ToLower()))
{
    message.From = organizer;
}
else
{
    //such as your actual email sender, in our case, our mail sender use another email,
    //say ActualSender,and if leave empty, then our mail sender will fill as:
    message.From = ActualSenderEmail;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!