I have this code which retrivies emails given an user email address
async def get_mails(self, *, address: str, days: int = 30) -> list[Message]:
uuid = await self._get_uuid(address)
if not uuid:
return []
end = datetime.now(timezone.utc) + timedelta(days=1)
start = end - timedelta(days=days)
query_params = MessagesRequestBuilder.MessagesRequestBuilderGetQueryParameters(
filter=" ".join(
f"""
(receivedDateTime ge {start.strftime('%Y-%m-%dT%H:%M:%SZ')})
and
(receivedDateTime le {end.strftime("%Y-%m-%dT%H:%M:%SZ")})
""".split()
),
orderby=["receivedDateTime"],
include_hidden_messages="true"
)
request_config = (
MessagesRequestBuilder.MessagesRequestBuilderGetRequestConfiguration(
query_parameters=query_params,
)
)
result = await self.graph_client.users.by_user_id(uuid).messages.get(request_config)
if not result or not result.value:
return []
return result.value
The problem is: I am not sure about the refresh rate, but new emails are not showing. I have tried external emails and internal ones, no one of them.
The flag include_hidden_messages
is totally undocumented, there is nothing in the internet, is that parameter correct?