summaryrefslogtreecommitdiff
path: root/scripts/p7s
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-10-17 22:35:36 +0200
committeralex <alex@pdp7.net>2023-10-17 22:35:36 +0200
commit383b44845e66a65c31bd9f284ea3c3b3f59aaff7 (patch)
tree6343511a0bcadfd86731e2aef371e8f0fca48eb5 /scripts/p7s
parentea7726c3df7540972eb803d1f190cd484e8a2f86 (diff)
Initial add
Diffstat (limited to 'scripts/p7s')
-rw-r--r--scripts/p7s/mbsync.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/scripts/p7s/mbsync.py b/scripts/p7s/mbsync.py
new file mode 100644
index 00000000..8c4194e3
--- /dev/null
+++ b/scripts/p7s/mbsync.py
@@ -0,0 +1,29 @@
+import pathlib
+import textwrap
+
+from p7s import bitwarden
+
+
+def generate_config():
+ gmail_password = bitwarden.get_item("https://bitwarden.pdp7.net", "alex@corcoles.net", "cad137b0-cfd5-4d5c-b167-98a9e792f4cc")["login"]["password"]
+ (pathlib.Path.home() / (".mbsyncrc")).write_text(textwrap.dedent(f"""
+ IMAPStore gmail-remote
+ Host imap.gmail.com
+ SSLType IMAPS
+ AuthMechs LOGIN
+ User koalillo@gmail.com
+ Pass "{gmail_password}"
+
+ MaildirStore gmail-local
+ Path ~/Mail/koalillo@gmail.com/
+ Inbox ~/Mail/koalillo@gmail.com/INBOX
+ Subfolders Verbatim
+
+ Channel gmail
+ Far :gmail-remote:
+ Near :gmail-local:
+ Create Both
+ Expunge Both
+ Patterns *
+ SyncState *
+ """))