954 (@954-Ivory)微软邮箱 oauth imap 登录 中发帖

参考了 https://linux.do/t/topic/227012 大佬的代码 
因为多数场景是直接集成到代码里,不需要图形化,所以写了个精简版本
我个人比较喜欢用 httpx,不习惯的小伙伴可以换成 requests
import imaplib
from contextlib import contextmanager

import httpx

client = httpx.Client()


class MSMailAccount:
def __init__(self, raw_str, client_id=None, separator='----'):
datas = raw_str.split(separator)
self.username = datas[0]
self.password = datas[...