aboutsummaryrefslogtreecommitdiffstats
path: root/worker/notmuch/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/notmuch/worker.go')
-rw-r--r--worker/notmuch/worker.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/worker/notmuch/worker.go b/worker/notmuch/worker.go
index d5c012ad..a7bab688 100644
--- a/worker/notmuch/worker.go
+++ b/worker/notmuch/worker.go
@@ -49,6 +49,8 @@ type worker struct {
watcher types.FSWatcher
watcherDebounce *time.Timer
capabilities *models.Capabilities
+ headers []string
+ headersExclude []string
}
// NewWorker creates a new notmuch worker with the provided worker.
@@ -223,6 +225,8 @@ func (w *worker) handleConfigure(msg *types.Configure) error {
}
w.store = store
}
+ w.headers = msg.Config.Headers
+ w.headersExclude = msg.Config.HeadersExclude
return nil
}
@@ -676,6 +680,12 @@ func (w *worker) emitMessageInfo(m *Message,
if err != nil {
return fmt.Errorf("could not get MessageInfo: %w", err)
}
+ switch {
+ case len(w.headersExclude) > 0:
+ lib.LimitHeaders(info.RFC822Headers, w.headersExclude, true)
+ case len(w.headers) > 0:
+ lib.LimitHeaders(info.RFC822Headers, w.headers, false)
+ }
w.w.PostMessage(&types.MessageInfo{
Message: types.RespondTo(parent),
Info: info,