From c756cf590ab20ae90979b0a71b43f600dfbd1224 Mon Sep 17 00:00:00 2001 From: alex Date: Thu, 19 Oct 2023 22:09:54 +0200 Subject: Refactor mbsync stuff --- scripts/p7s/mail/mbsync.py | 54 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 scripts/p7s/mail/mbsync.py (limited to 'scripts/p7s/mail/mbsync.py') diff --git a/scripts/p7s/mail/mbsync.py b/scripts/p7s/mail/mbsync.py new file mode 100644 index 00000000..0aabeea1 --- /dev/null +++ b/scripts/p7s/mail/mbsync.py @@ -0,0 +1,54 @@ +import textwrap + + +def mbsync_gmail(login, password, store_path): + return textwrap.dedent(f""" + IMAPAccount {login} + Host imap.gmail.com + SSLType IMAPS + User {login} + Pass {password} + + IMAPStore {login}-remote + Account {login} + + MaildirStore {login}-local + SubFolders Verbatim + Path {store_path}/{login}/ + Inbox {store_path}/{login}/Inbox + + Channel {login} + Far :{login}-remote: + Near :{login}-local: + Patterns * + Create Both + Expunge Both + SyncState * + """).lstrip() + + +def mbsync_yahoo(login, password, store_path): + return textwrap.dedent(f""" + IMAPAccount {login} + Host imap.mail.yahoo.com + SSLType IMAPS + User {login} + Pass {password} + PipelineDepth 5 + + IMAPStore {login}-remote + Account {login} + + MaildirStore {login}-local + SubFolders Verbatim + Path {store_path}/{login}/ + Inbox {store_path}/{login}/Inbox + + Channel {login} + Far :{login}-remote: + Near :{login}-local: + Patterns * + Create Both + Expunge Both + SyncState * + """).lstrip() -- cgit v1.2.3