Mailbox - can't query message "body"
See original GitHub issueThough subject is easy to query, I don’t see any documented way to query the message body. The obvious approach using mailbox queries does not work. I’ve tried many attributes names for the body, for example:
query = mailbox.new_query('body').contains('word')
query = mailbox.new_query('body_html').contains('word')
query = mailbox.new_query('body_content').contains('word')
query = mailbox.new_query('body/content').contains('word')
All of these attempts return 400 Client Error.
messages = mailbox.get_messages(limit=25, query=query)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://graph.microsoft.com/v1.0/users/(omitted@company.com)?%24top=25&%24filter=contains(body%2C+'change') | Error Message: Invalid filter clause
Is there a different attribute to query, or is this a bug?
Issue Analytics
- State:
- Created 4 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Search Mail and People in Outlook.com - Microsoft Support
Use Advanced Query Search to refine results ; Body or Content. Searches the message body. Body:report ; Sent. Searches the date sent. You...
Read more >How to use query for Office 365 Get Mail activity? - Learn
I am trying to retrieve email from Office 365 outlook. I have already got it to retrieve all emails in the specified folder, ......
Read more >Search for emails in Mail on Mac - Apple Support
Search for emails using Mail suggestions and search filters If there are no results in the current mailbox, click “Search all mailboxes” below...
Read more >Troubleshooting Database Mail Failures - SQLShack
In this article you will see how to troubleshoot Database Mail Failures which is a convenient and easy way to send alerts, reports, ......
Read more >Microsoft Graph API returns mail message body as HTML
Headers.Add("outlook.body-content-type", "text"); still doesnt work. Any other way to specify the header?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay this works. I can actually make complex search criteria using AND, OR, NOT operators.
mailbox.new_query().search('body:word AND received>=2019-04-05')
Thank you!
Well, you can always filter by code.