notebook
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/usr/bin/env python3
|
||||
# -*- coding: utf-8 -*-
|
||||
"""Rychly test: odpovida MailStore IMAP?"""
|
||||
import imaplib, ssl, time
|
||||
MS_HOST="192.168.1.53"; IMAP_PORT=143
|
||||
MS_USER="admin"; MS_PASS='*$N(B)vMUym!%'
|
||||
for i in range(1,4):
|
||||
try:
|
||||
ctx=ssl.create_default_context(); ctx.check_hostname=False; ctx.verify_mode=ssl.CERT_NONE
|
||||
t0=time.time()
|
||||
M=imaplib.IMAP4(MS_HOST,IMAP_PORT); M.starttls(ssl_context=ctx); M.login(MS_USER,MS_PASS)
|
||||
print(f"pokus {i}: OK za {time.time()-t0:.1f}s, CAP={M.capabilities}")
|
||||
M.logout(); break
|
||||
except Exception as ex:
|
||||
print(f"pokus {i}: SELHAL {type(ex).__name__}: {ex}")
|
||||
time.sleep(3)
|
||||
Reference in New Issue
Block a user