From 10f61576fd8789876fa48ec985ea72389c254cb9 Mon Sep 17 00:00:00 2001 From: Toby Vincent Date: Tue, 28 Mar 2023 16:12:55 -0500 Subject: feat(mbsync): add mbsync configs for syncing IMAP gmail --- mbsync/.config/mbsync/mbsyncrc | 48 ++++++++++++++++++++++++++++++ mbsync/.config/systemd/user/mbsync.service | 9 ++++++ mbsync/.config/systemd/user/mbsync.timer | 10 +++++++ 3 files changed, 67 insertions(+) create mode 100644 mbsync/.config/mbsync/mbsyncrc create mode 100644 mbsync/.config/systemd/user/mbsync.service create mode 100644 mbsync/.config/systemd/user/mbsync.timer diff --git a/mbsync/.config/mbsync/mbsyncrc b/mbsync/.config/mbsync/mbsyncrc new file mode 100644 index 0000000..e8fe3e1 --- /dev/null +++ b/mbsync/.config/mbsync/mbsyncrc @@ -0,0 +1,48 @@ +IMAPAccount gmail +Host imap.gmail.com +User tobyv13@gmail.com +PassCmd "pass gmail" +SSLType IMAPS +CertificateFile /etc/ssl/certs/ca-certificates.crt + +IMAPStore gmail-remote +Account gmail + +MaildirStore gmail-local +Path ~/.local/share/mail/gmail/ +Inbox ~/.local/share/mail/gmail/INBOX + +Channel gmail-inbox +Far :gmail-remote: +Near :gmail-local: +Patterns "INBOX" +Create Both +Expunge Both +SyncState * + +Channel gmail-drafts +Far :gmail-remote:"[Gmail]/Drafts" +Near :gmail-local:drafts +Create Both +Expunge Both +SyncState * + +Channel gmail-sent +Far :gmail-remote:"[Gmail]/Sent Mail" +Near :gmail-local:sent +Create Both +Expunge Both +SyncState * + +Channel gmail-trash +Far :gmail-remote:"[Gmail]/Trash" +Near :gmail-local:trash +Create Both +Expunge Both +SyncState * + +Group gmail +Channel gmail-inbox +Channel gmail-drafts +Channel gmail-sent +Channel gmail-trash diff --git a/mbsync/.config/systemd/user/mbsync.service b/mbsync/.config/systemd/user/mbsync.service new file mode 100644 index 0000000..6a03bfc --- /dev/null +++ b/mbsync/.config/systemd/user/mbsync.service @@ -0,0 +1,9 @@ +[Unit] +Description=Mailbox synchronization service + +[Service] +Type=oneshot +ExecStart=/usr/bin/mbsync -c ${XDG_CONFIG_HOME}/mbsync/mbsyncrc -Va + +[Install] +WantedBy=default.target diff --git a/mbsync/.config/systemd/user/mbsync.timer b/mbsync/.config/systemd/user/mbsync.timer new file mode 100644 index 0000000..82ebb83 --- /dev/null +++ b/mbsync/.config/systemd/user/mbsync.timer @@ -0,0 +1,10 @@ +[Unit] +Description=Mailbox synchronization timer + +[Timer] +OnBootSec=2m +OnUnitActiveSec=5m +Unit=mbsync.service + +[Install] +WantedBy=timers.target -- cgit v1.2.3-70-g09d2