summaryrefslogtreecommitdiff
path: root/scripts/mumi.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/mumi.in')
-rw-r--r--scripts/mumi.in17
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/mumi.in b/scripts/mumi.in
index 2abfd51..3bd34f4 100644
--- a/scripts/mumi.in
+++ b/scripts/mumi.in
@@ -94,4 +94,21 @@
(when repl-port
(spawn-server (make-tcp-server-socket #:port repl-port)))))))
+;; Keep indexing the mail directory
+(define %mu-index-interval 30)
+(define mu-index
+ (let ((mu (%config 'mu-executable)))
+ (lambda _
+ (let* ((maildir (%config 'mail-dir))
+ (args (list "index"
+ "--quiet"
+ (format #f "--muhome=~a" maildir)
+ (format #f "--maildir=~a" maildir))))
+ (unless (zero? (apply system* mu args))
+ (format (current-error-port)
+ "Failed to run `~a'~%" command))
+ (alarm %mu-index-interval)))))
+(sigaction SIGALRM mu-index 0)
+(mu-index)
+
(start-mumi-web-server 1234)