Forum Discussion
Mailtips - deliveryRestriction returns incorrect result with acceptedSenders having nested lists
Hello Graph Community,
I'm in the process of developing a graph solution where I can check if a mailbox or from address has permission to send to a Distribution list when that list has acceptedSenders, meaning only members added to "Specified Senders" in Exchange can send to that list. If they are not a member they generally will receive a tooltip and an NDR if they hit send.
$(Get-DistributionGroup "<DL HERE>") | select GroupType, alias, AcceptMessagesOnlyFrom, AcceptMessagesOnlyFromDLMembers, AcceptMessagesOnlyFromSendersOrMembers
emailAddress : @{name=; address=lockedDL@@contoso.org}
3 Replies
- Graph is not the best tool for this, as it has very limited support for Exchange operations. If you must use Graph methods, I'd suggest expanding the group membership (/transitivemembers) or getting the user's transitive membership (/transitiveMemberOf) in order to check whether he is a member of any listed groups, potentially with nested membership.
Also keep in mind that MailTips might be disabled in the organization.- Polite603Copper Contributor
Mailtips being disabled is possible, it does however function in most cases when it is enabled.
Without knowing the acceptedSenders population prior though, its not possible to query those nested lists.
There does seem to be an effort to make this "acceptedSenders" property available. I've attempted to use the /acceptedSenders endpoint but its under the beta flag. How can I test this endpoint to see if it would be a viable solution in a future graph version?
https://learn.microsoft.com/en-us/graph/api/group-list-acceptedsenders?view=graph-rest-1.0&tabs=http- It is not, this endpoint only works for M365 Groups, not DGs.