From 4aad8660f75687f2d4de5540dc5ff95a0b0fa5bd Mon Sep 17 00:00:00 2001 From: Sakooooo <78461130+Sakooooo@users.noreply.github.com> Date: Wed, 9 Oct 2024 19:27:32 +0400 Subject: [PATCH] c --- config/emacs/.offlineimap.py | 6 ++++++ config/emacs/.offlineimaprc | 21 ++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/config/emacs/.offlineimap.py b/config/emacs/.offlineimap.py index b53741ba..fed1df0b 100644 --- a/config/emacs/.offlineimap.py +++ b/config/emacs/.offlineimap.py @@ -13,6 +13,12 @@ def get_user(account): return re.search(rb"login: (.*)", usercmd, flags=0).group(1).decode("utf-8") +def get_host(account): + usercmd = check_output("pass " + account, shell=True) + + return re.search(rb"host: (.*)", usercmd, flags=0).group(1).decode("utf-8") + + def hydroxide(path): file = open(path, "r") diff --git a/config/emacs/.offlineimaprc b/config/emacs/.offlineimaprc index ffec3266..d2fce051 100644 --- a/config/emacs/.offlineimaprc +++ b/config/emacs/.offlineimaprc @@ -90,4 +90,23 @@ oauth2_client_id_eval = get_client_id("email/oauth/gmail") oauth2_client_secret_eval = get_client_secret("email/oauth/gmail") oauth2_refresh_token_eval = get_client_refresh_token("accounts.google.com/two") # Google IMAP weirdness -nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f \ No newline at end of file +nametrans = lambda f: f.replace('[Gmail]/', '') if f.startswith('[Gmail]/') else f + +[Account li] +localrepository = li-local +remoterepository = li-remote +proxy = SOCKS5:localhost:9050 + +[Repository li-local] +type = Maildir +localfolders = ~/Mail/li + +[Repository li-remote] +type = IMAP +ssl = yes +sslcacertfile = /etc/ssl/certs/ca-certificates.crt +remotehosteval = get_host("email/li") +remoteport = 993 +remoteusereval = get_user("email/li") +remotepasseval = get_pass("email/li") +