diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py new file mode 100644 index 00000000..79f37aae --- /dev/null +++ b/config/emacs/.offlineimap.py @@ -0,0 +1,162 @@ +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) + + +#! /usr/bin/env python +from subprocess import check_output +import re + + +def get_pass(account): + return check_output("pass " + account, shell=True).splitlines()[0] + + +def get_user(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"login: (.*)", usercmd, flags=0).group(1) + + +def hydroxide(path): + + file = open(path, "r") + + pword = file.read() + + return pword + + +class oauth: + def get_client_id(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_id: (.*)", cmd, flags=0).group(1) + + def get_client_secret(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_secret: (.*)", cmd, flags=0).group(1) + + def get_client_token(account): + cmd = check_output("pass " + account, shell=True) + + return re.search(rb"client_token: (.*)", cmd, flags=0).group(1) diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc new file mode 100644 index 00000000..c8657e20 --- /dev/null +++ b/config/emacs/.offlineimaprc @@ -0,0 +1,19 @@ +[general] +pythonfile = ~/.offlineimap.py +accounts = Proton + +[Account Proton] +localrepository = Proton-local +remoterepository = Proton-remote + +[Repository Proton-local] +type = Maildir +localfolders = ~/Mail/Proton + +[Repository Proton-remote] +type = IMAP +ssl = no +remotehost = 127.0.0.1 +remoteport = 1143 +remoteusereval = get_user("Proton\ Account") +remotepasseval = hydroxide("/home/sako/.hydroxide-bridge-pass") \ No newline at end of file