public override void SetMailboxOwnerAsSender(MessageItem message) { PublicFolderSession publicFolderSession = base.StoreSession as PublicFolderSession; if (base.CurrentFolder.PropertyBag.GetValueOrDefault <bool>(FolderSchema.MailEnabled)) { Exception ex = null; try { byte[] valueOrDefault = base.CurrentFolder.PropertyBag.GetValueOrDefault <byte[]>(FolderSchema.ProxyGuid); if (valueOrDefault != null && valueOrDefault.Length == 16) { IRecipientSession adrecipientSession = publicFolderSession.GetADRecipientSession(true, ConsistencyMode.PartiallyConsistent); ADRawEntry adrawEntry = adrecipientSession.Read(new ADObjectId(valueOrDefault)) as ADPublicFolder; if (adrawEntry != null) { message.From = new Participant(adrawEntry); return; } } ex = new ObjectNotFoundException(ServerStrings.ExItemNotFound); } catch (ADTransientException ex2) { ex = ex2; } catch (ADExternalException ex3) { ex = ex3; } catch (ADOperationException ex4) { ex = ex4; } catch (DataValidationException ex5) { ex = ex5; } catch (ObjectNotFoundException ex6) { ex = ex6; } if (ex != null) { StorageGlobals.EventLogger.LogEvent(StorageEventLogConstants.Tuple_PFRuleSettingFromAddressFailure, base.CurrentFolder.StoreObjectId.ToHexEntryId(), new object[] { ex }); } } message.From = (publicFolderSession.ConnectAsParticipant ?? new Participant(publicFolderSession.MailboxPrincipal)); }