When filtering messages on MS Graph REST API using the "from/emailAddress/address" eq '<SENDER_EMAIL>'' it is not returning any email even though with this particular sender, emails exists in the inbox.
When filtering messages on MS Graph REST API using the from/emailAddress/address eq '<SENDER_EMAIL>' it is not returning any email even though with this particular sender, emails exists in the inbox.
but if we are using StartsWith(from/emailAddress/address,'<SENDER_EMAIL>') then filtering is working fine and returning the expected results.
Following are other important details :-
- It is observed that When Receiver and Sender email accounts are created as Shared MailBox under one TenantId then the exact match of sender is not returning the result but StartsWith is working
for eg :-
This is Not Working - Not Returning any Result
https://graph.microsoft.com/v1.0/users/<USER_EMAIL>/messages?$filter=receivedDateTime ge 2025-01-30T02:19:29Z and from/emailAddress/address eq '<SENDER_EMAIL>' &$top=10&$skip=0
This is Working - Returning expected Result
https://graph.microsoft.com/v1.0/users/<USER_EMAIL>/messages?$filter=receivedDateTime ge 2025-01-30T02:19:29Z and StartsWith(from/emailAddress/address,'<SENDER_EMAIL>') &$top=10&$skip=0
- When filtering only based on receivedDateTime ge then we can see the expected results but if we put one more filter based on from/emailAddress/address then the Emails which were returned are not not being returned
for eg :-
https://graph.microsoft.com/v1.0/users/<USER_EMAIL>/messages?$filter=receivedDateTime ge 2025-01-30T02:19:29Z &$top=10&$skip=0
Total Emails Returned : 10, in this Result there are total 3 emails with one particular SENDER
https://graph.microsoft.com/v1.0/users/<USER_EMAIL>/messages?$filter=receivedDateTime ge 2025-01-30T02:19:29Z and from/emailAddress/address eq '<SENDER_EMAIL>' &$top=10&$skip=0
Total Emails Returned : 0
so if i add one more filter based on from/emailAddress/address eq '<SENDER_EMAIL>' then ideally it should return 3 Emails but as i add filter based on from then it doesn't return any email
but if instead of exact match if i use StartsWith then it is working fine.
Please Note above problem is happening only with few specific SENDER where SENDER account is created using Shared Mail Box.
--> It Seems that from/emailAddress/address eq is not able to filter data properly and causing issue for few specific SENDER whereas StartsWith works fine in all cases.
--> There is no case sensitive problem or SENDER name problem , we have throughly checked all possible things from our end.
Please help us to understand the problem and root cause, why we are seeing diff behaviour for the same dataset.