aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch
diff options
context:
space:
mode:
authorTim Culverhouse <tim@timculverhouse.com>2022-07-29 13:30:01 -0500
committerRobin Jarry <robin@jarry.cc>2022-08-01 10:31:59 +0200
commit44651b43b3a59d35b98936e0bcd4edf797f68b42 (patch)
treeba3bf11eb57fe2f55409e2144f5b6d44c0a7f114 /worker/notmuch
parentc816103a24757bd0e91f7d96b60073a3063bc85a (diff)
downloadaerc-44651b43b3a59d35b98936e0bcd4edf797f68b42.tar.gz
checkmail: error if check-mail-cmd is not set
Send error message to UI if check-mail-cmd is required but not set. Signed-off-by: Tim Culverhouse <tim@timculverhouse.com> Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'worker/notmuch')
-rw-r--r--worker/notmuch/worker.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index 28029b26..36ef10f6 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -647,6 +647,10 @@ func (w *worker) sort(uids []uint32,
}
func (w *worker) handleCheckMail(msg *types.CheckMail) {
+ if msg.Command == "" {
+ w.err(msg, fmt.Errorf("checkmail: no command specified"))
+ return
+ }
ctx, cancel := context.WithTimeout(context.Background(), msg.Timeout)
defer cancel()
cmd := exec.CommandContext(ctx, "sh", "-c", msg.Command)