]> xn--ix-yja.es Git - alex.git/commitdiff
Initial add
authoralex <alex@pdp7.net>
Tue, 17 Oct 2023 20:35:36 +0000 (22:35 +0200)
committeralex <alex@pdp7.net>
Tue, 17 Oct 2023 20:35:36 +0000 (22:35 +0200)
scripts/p7s/mbsync.py [new file with mode: 0644]

diff --git a/scripts/p7s/mbsync.py b/scripts/p7s/mbsync.py
new file mode 100644 (file)
index 0000000..8c4194e
--- /dev/null
@@ -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 *
+    """))