initial commit

This commit is contained in:
Daniel 2023-12-04 12:40:57 +01:00
parent 42ed64353b
commit ee4d356506

View file

@ -0,0 +1,33 @@
# %%
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()