ensure_connection() reconnected via connect(), which only reaches IMAP state AUTH, not SELECTED - every search/fetch/store after a mid-pass link drop silently failed (swallowed into []/None/False) because aioimaplib rejects those commands outside SELECTED. Track the currently-selected folder and re-select it after reconnecting; note pre-reconnect sequence-number ids are invalid post-reconnect unless use_uid=True. Also add an asyncio.Lock around connect()/close()/ensure_connection(): concurrent callers on one instance used to race inside connect(), where task B's `await self.close()` tore down task A's mid-handshake connection, leaking sockets and orphaning server sessions. Superseded connections are now always logged out instead of silently overwritten. Bump to 0.1.6, update README install pins. Signed-off-by: disqualifier <dev@disqualifier.me>
20 lines
434 B
TOML
20 lines
434 B
TOML
[build-system]
|
|
requires = ["hatchling"]
|
|
build-backend = "hatchling.build"
|
|
|
|
[project]
|
|
name = "aiomail"
|
|
version = "0.1.6"
|
|
description = "async IMAP one-time-code retrieval with password/OAuth2 auth and dynamic matching"
|
|
requires-python = ">=3.10"
|
|
dependencies = [
|
|
"aioimaplib>=1.0",
|
|
"beautifulsoup4>=4.11",
|
|
]
|
|
|
|
[project.optional-dependencies]
|
|
oauth = ["aiohttp>=3.9"]
|
|
|
|
[tool.hatch.build.targets.wheel]
|
|
packages = ["src/aiomail"]
|