summaryrefslogtreecommitdiff
path: root/.config/mutt/mailboxes.py
diff options
context:
space:
mode:
Diffstat (limited to '.config/mutt/mailboxes.py')
-rwxr-xr-x.config/mutt/mailboxes.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/.config/mutt/mailboxes.py b/.config/mutt/mailboxes.py
new file mode 100755
index 0000000..1538122
--- /dev/null
+++ b/.config/mutt/mailboxes.py
@@ -0,0 +1,12 @@
+import sys
+import json
+
+account = str(sys.argv[1])
+
+mailboxes = []
+with open('/home/lys/.offlineimap/mbnames/{}.json'.format(account), 'r') as f:
+ data = json.load(f)
+ for folder in data:
+ mailboxes.append('"+{}/{}"'.format(account,folder['foldername']))
+
+print('{}'.format(' '.join(mailboxes)))