
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
pip install asocksimap
or
pip install git+https://github.com/optinsoft/asocksimap.git
import asyncio
from asocksimap import AsyncSocksIMAP4_SSL
from functools import reduce
def checkResponse(res, func):
if res.result != 'OK':
msg = reduce(lambda s, i: (s + "\n " if i > 0 else "") + res.lines[i].decode('utf8'), range(len(res.lines)), "")
if not msg: msg = f"{func} failed"
raise Exception(msg)
async def aimap_test():
email_address = 'YOUR_ACCOUNT@hotmail.com'
password = 'YOUR_PASSWORD'
imap_server = 'outlook.office365.com'
imap_port = 993
socks_addr = '127.0.0.1'
socks_port = 1080
socks_type = 'socks5'
aimap = AsyncSocksIMAP4_SSL(host=imap_server, port=imap_port, timeout=15,
proxy_addr=socks_addr, proxy_port=socks_port, proxy_type=socks_type)
await aimap.wait_hello_from_server()
res = await aimap.login(email_address, password)
checkResponse(res, "login")
res = await aimap.logout()
checkResponse(res, "logout")
loop = asyncio.get_event_loop()
loop.run_until_complete(aimap_test())
FAQs
Connect to IMAP through Socks using Python asyncio
We found that asocksimap demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.