summaryrefslogtreecommitdiff
path: root/scripts/mumi.in
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2019-07-21 12:30:44 +0200
committerRicardo Wurmus <rekado@elephly.net>2019-07-21 13:11:39 +0200
commit64bf6d70099c59ea442bf1641caaab8ad03ce9cd (patch)
tree7704da71442805deb0c0657fcee36c938d324a86 /scripts/mumi.in
parentcaa127d37e9e682a461b0d628b58eb80e074c792 (diff)
scripts: Regularly index the mail directory.
* configure.ac: Detect mu. * guix.scm: Add "mu" to the environment. * mumi/config.scm.in (%config)[mu-executable]: Add it. * scripts/mumi.in: Spawn "mu index" regularly.
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)