e2e_tests/prototyping/email_stuff.py
2023-12-04 12:40:57 +01:00

33 lines
630 B
Python

# %%
import base64
import email
import imaplib
# %%
import json
from imaplib import IMAP4, IMAP4_SSL
from pathlib import Path
# -------------------------------- credentials ------------------------------- #
cred_file = Path("../credentials.json")
with open(cred_file, "r") as f:
CREDENTIALS = json.load(f)
username = CREDENTIALS["imap_user"]
password = CREDENTIALS["imap_pass"]
# ----------------------------------- imap ----------------------------------- #
host = "mail.local-it.org"
imap_port = 143
imap_ssl_port = 993
# with IMAP4("domain.org") as M:
# M.noop()
with IMAP4_SSL(host=host) as M:
M.noop()