config/emacs: offlineimap config init

This commit is contained in:
Sakooooo 2024-09-23 11:50:35 +04:00
parent aedaee9745
commit 682bdb1fb8
Signed by: sako
GPG key ID: 3FD715D87D7725E0
2 changed files with 181 additions and 0 deletions

View file

@ -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)

View file

@ -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")