config/emacs: hopefully add outlook support to offlineimap
This commit is contained in:
parent
a3a383707d
commit
f33ec26dbf
|
@ -160,3 +160,8 @@ class oauth:
|
||||||
cmd = check_output("pass " + account, shell=True)
|
cmd = check_output("pass " + account, shell=True)
|
||||||
|
|
||||||
return re.search(rb"client_token: (.*)", cmd, flags=0).group(1)
|
return re.search(rb"client_token: (.*)", cmd, flags=0).group(1)
|
||||||
|
|
||||||
|
def get_client_refresh_token(account):
|
||||||
|
cmd = check_output("pass " + account, shell=True)
|
||||||
|
|
||||||
|
return re.search(rb"client_refresh_token: (.*)", cmd, flags=0).group(1)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[general]
|
[general]
|
||||||
pythonfile = ~/.offlineimap.py
|
pythonfile = ~/.offlineimap.py
|
||||||
accounts = Proton
|
accounts = Proton, Outlook
|
||||||
|
|
||||||
[Account Proton]
|
[Account Proton]
|
||||||
localrepository = Proton-local
|
localrepository = Proton-local
|
||||||
|
@ -17,4 +17,24 @@ remotehost = 127.0.0.1
|
||||||
remoteport = 1143
|
remoteport = 1143
|
||||||
remoteusereval = get_user("Proton\ Account")
|
remoteusereval = get_user("Proton\ Account")
|
||||||
remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass")
|
remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass")
|
||||||
folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ]
|
folderfilter = lambda foldername: foldername in [ "All Mail", "Archive", "Drafts", "INBOX", "Sent", "Spam", "Starred", "Trash" ]
|
||||||
|
|
||||||
|
[Account Outlook]
|
||||||
|
localrepostiory = Outlook-local
|
||||||
|
remoterepository = Outlook-remote
|
||||||
|
|
||||||
|
[Repository Outlook-local]
|
||||||
|
type = maildir
|
||||||
|
localfolders = ~/Mail/Outlook
|
||||||
|
|
||||||
|
[Repository Outlook-remote]
|
||||||
|
type = IMAP
|
||||||
|
remoteusereval = get_user("Microsoft")
|
||||||
|
remotehost = outlook.office365.com
|
||||||
|
remoteport = 993
|
||||||
|
auth_mechanisms = XOAUTH2
|
||||||
|
oauth2_request_url = https://login.microsoftonline.com/common/oauth2/v2.0/token
|
||||||
|
oauth2_client_id = 9e5f94bc-e8a4-4e73-b8be-63364c29d753 # thunderbird's token not mine lol
|
||||||
|
oauth2_client_secret = "" # no need for this lmao
|
||||||
|
oauth2_refresh_token_eval = oauth.get_client_refresh_token("Microsoft")
|
||||||
|
oauth2_access_token_eval = oauth.get_client_token("Microsoft")
|
Loading…
Reference in a new issue