summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-26 10:07:54 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-04-16 13:07:22 -0700
commit1de6c9974ed4cd6104f188eb754872feec732c43 (patch)
tree5dee603f1fe9d895bb9613007063bb00f37209f9
parent767e6196aedbc9b27223362c0d2abd41f55f24b8 (diff)
downloaddotfiles-1de6c9974ed4cd6104f188eb754872feec732c43.tar.gz
movemymail: immediately upload fetched mail
-rwxr-xr-xbin/movemymail19
1 files 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