Browse Source

Allow syncing of just inbox rather than all mailboxes

master
Jonathan Hodgson 1 year ago
parent
commit
acba5f4559
  1. 12
      bin/.bin/emails/check-emails
  2. 12
      isync/.config/isync/mbsyncrc
  3. BIN
      isync/.config/isync/mbsyncrc.secret
  4. 5
      mutt/.config/mutt/muttrc

12
bin/.bin/emails/check-emails

@ -10,6 +10,11 @@ die(){
exit 1
}
export NOTMUCH_CONFIG="$HOME/.config/notmuch/config"
folder="${1:-all}"
# Ping 1.1.1.1 to confirm that we are on the internet
ping -c 1 "1.1.1.1" > /dev/null 2> /dev/null || die "Need to be connected to the internet"
@ -17,7 +22,12 @@ ping -c 1 "1.1.1.1" > /dev/null 2> /dev/null || die "Need to be connected to the
ps -aux | grep -v grep | grep -q davmail || die "Need to start davmail"
# Sync maildir with exchange
mbsync -c "$HOME/.config/isync/mbsyncrc.secret" work
mbsync -c "$HOME/.config/isync/mbsyncrc.secret" "work-$folder"
# Update notmuch database
notmuch new
new="$(notmuch count "tag:unread")"
[ "$new" -gt "0" ] && notify-send "$new new messages"

12
isync/.config/isync/mbsyncrc

@ -20,7 +20,7 @@ Subfolders Verbatim
Path ~/.mail/work/
Inbox ~/.mail/work/Inbox
Channel work
Channel work-all
Master :work-remote:
Slave :work-local:
# Include everything, except Sync Issues
@ -29,3 +29,13 @@ Patterns * !'Sync Issues' !'Sync Issues/*'
Create Both
# Save the synchronization state files in the relevant directory
SyncState *
Channel work-inbox
Master :work-remote:
Slave :work-local:
# Only sync Inbox
Patterns Inbox Sent
# Automatically create missing mailboxes, both locally and on the server
Create Both
# Save the synchronization state files in the relevant directory
SyncState *

BIN
isync/.config/isync/mbsyncrc.secret

Binary file not shown.

5
mutt/.config/mutt/muttrc

@ -82,7 +82,8 @@ bind index N search-opposite
macro index C "<copy-message>?<toggle-mailboxes>" "copy a message to a mailbox"
macro index M "<save-message>?<toggle-mailboxes>" "move a message to a mailbox"
macro index o "<shell-escape>check-emails<enter>" "Check Emails"
macro index o "<shell-escape>check-emails inbox<enter>" "Check Emails"
macro index O "<shell-escape>check-emails<enter>" "Check Emails"
######################
# Sidebar Settings #
######################
@ -170,7 +171,7 @@ macro index,pager a "<pipe-message>abook --add-email-quiet<return>" "Add this s
# Don't ask to push enter after external command is run
set wait_key = no # https://neomutt.org/guide/reference#wait_key
# Send a notification when a new email arrives
set new_mail_command = "notify-send 'New Email'" # https://neomutt.org/guide/reference#new_mail_command
# set new_mail_command = "notify-send 'New Email'" # https://neomutt.org/guide/reference#new_mail_command
# Makes escape key cancel inputs. Normally it's ctrl+G (weird)
set abort_key = "<Esc>" # https://neomutt.org/guide/reference#abort_key
# My Name

Loading…
Cancel
Save