diff --git a/src/aiomail/client.py b/src/aiomail/client.py index 5932139..8d06419 100644 --- a/src/aiomail/client.py +++ b/src/aiomail/client.py @@ -245,12 +245,18 @@ class IMAPClient: return None async def mark_seen(self, email_id: int) -> bool: - """flag a message as read without deleting it""" + """flag a message as read without deleting it + + aioimaplib does not apply its own timeout to the UID STORE command path, so the + use_uid=True call is wrapped here to bound it the same as the non-uid path. + """ if not await self.ensure_connection(): return False try: if self.use_uid: - result, _ = await self._mail.uid("store", str(email_id), "+FLAGS", "(\\Seen)") + result, _ = await asyncio.wait_for( + self._mail.uid("store", str(email_id), "+FLAGS", "(\\Seen)"), self.timeout + ) else: result, _ = await self._mail.store(str(email_id), "+FLAGS", "(\\Seen)") return result == "OK"