config/emacs: offlineimap config init
This commit is contained in:
parent
aedaee9745
commit
682bdb1fb8
2 changed files with 181 additions and 0 deletions
162
config/emacs/.offlineimap.py
Normal file
162
config/emacs/.offlineimap.py
Normal 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)
|
19
config/emacs/.offlineimaprc
Normal file
19
config/emacs/.offlineimaprc
Normal 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")
|
Loading…
Reference in a new issue