From 1de6c9974ed4cd6104f188eb754872feec732c43 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 26 Mar 2023 10:07:54 -0700 Subject: movemymail: immediately upload fetched mail --- bin/movemymail | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/bin/movemymail b/bin/movemymail index 8f5812f9..fbe76178 100755 --- a/bin/movemymail +++ b/bin/movemymail @@ -35,23 +35,24 @@ unless ($result and $result eq "Microsoft NCSI") { } system "postqueue", "-f"; -eval { system "mbsync", "fastmail" }; -if (my $exception = $@) { - local $ENV{XDG_RUNTIME_DIR} = "/run/user/$<"; - system "notify-send", "--urgency=critical", "--icon=dialog-warning", - "'mbsync fastmail' exited nonzero"; - die $exception; -} # athena's 'notmuch new' cronjob is responsible for imap-dl(1) runs. We have -# this here rather than separate cronjob entries so that hitting 'G' in -# athena's Emacs inbox displays new mail from the other accounts. +# this here rather than separate cronjob entries so that hopefully mbsync adds +# its UID to the filename before nnmaildir indexes the file. if (hostfqdn eq "athena.silentflame.com") { system "imap-dl", "$ENV{HOME}/.config/mailscripts/imap-dl.selene"; system "imap-dl", "$ENV{HOME}/.config/mailscripts/imap-dl.catmail"; system "imap-dl", "$ENV{HOME}/.config/mailscripts/imap-dl.gmail"; } +eval { system "mbsync", "fastmail" }; +if (my $exception = $@) { + local $ENV{XDG_RUNTIME_DIR} = "/run/user/$<"; + system "notify-send", "--urgency=critical", "--icon=dialog-warning", + "'mbsync fastmail' exited nonzero"; + die $exception; +} + # Move all mail new/ -> cur/ such that notmuch never sees anything in new/. # The reason for this is that notmuch tries to avoid moving files new/ -> cur/ # to avoid confusing Mutt, but messages in new/ aren't meant to have flags, so -- cgit v1.2.3