I'm using the ews-java-api to connect to an Exchange 2010 server, retrieve Appointments from it, parse over the attendee list of each appointment and if one of them is a distribution group I'm expanding it and replacing the group with the email list in my application.
I'm using the MailboxType property of the attendee in order to figure out which attendee is a distribution group by checking for the "PrivateDL" MailboxType. This works when my application is connecting to an Exchange 2013 or an Exchange 2016 server. When connecting to Exchange 2010 the MailboxType is always null. Below is a small piece of code I'm using to check for the mailbox type:
FolderId roomFolderId = new FolderId(WellKnownFolderName.Calendar, new Mailbox(roomEmail)); FindItemsResults<Appointment> appointments = exchangeService.findAppointments(roomFolderId, calendarView); for (Appointment appointment : appointments) { appointment.load(); log.info("Parsed appointment: " + appointment.getId()); for (Attendee attendee : appointment.getRequiredAttendees()) { log.info(" - attendee: " + attendee.getAddress()); log.info(" - mailbox type: " + attendee.getMailboxType()); }
For a meeting with one attendee I get the following:
1374 [main] INFO EWSTest - Parsed appointment: AAMkADQ1ZGIxZmM0LTM5MTEtNDhhYy04YWRmLTA2NTJiYzg2MjMzZABGAAAAAABVE7hxWhJkQ7Hq4/MBQ0WKBwBQSEDfqYqrSriR4eFxQpV2AAAAAAENAABQSEDfqYqrSriR4eFxQpV2AACbd+qIAAA= 1374 [main] INFO EWSTest - - attendee: attendee@mail.com 1374 [main] INFO EWSTest - - mailbox type: null
I've also checked the server response and the server won't return the MailboxType of an attendee but it will return the MailboxType of the organizer:
<t:Organizer><t:Mailbox><t:Name>Organizer Name</t:Name><t:EmailAddress>organizer@mail.com</t:EmailAddress><t:RoutingType>SMTP</t:RoutingType><t:MailboxType>Mailbox</t:MailboxType></t:Mailbox></t:Organizer><t:RequiredAttendees><t:Attendee><t:Mailbox><t:Name>Attendee name</t:Name><t:EmailAddress>attendee@mail.com</t:EmailAddress><t:RoutingType>SMTP</t:RoutingType></t:Mailbox><t:ResponseType>Unknown</t:ResponseType></t:Attendee></t:RequiredAttendees>Do I need to provide additional properties in the PropertySet used by the appointment.load() method or does something else need to be configured server side or is this an issues specific to Exchange Server 2010?