aboutsummaryrefslogtreecommitdiffstats
path: root/worker/maildir
diff options
context:
space:
mode:
Diffstat (limited to 'worker/maildir')
-rw-r--r--worker/maildir/worker.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index b222aab8..c45992eb 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -47,6 +47,8 @@ type Worker struct {
currentSortCriteria []*types.SortCriterion
maildirpp bool // whether to use Maildir++ directory layout
capabilities *models.Capabilities
+ headers []string
+ headersExclude []string
}
// NewWorker creates a new maildir worker with the provided worker.
@@ -349,6 +351,8 @@ func (w *Worker) handleConfigure(msg *types.Configure) error {
if err != nil {
return err
}
+ w.headers = msg.Config.Headers
+ w.headersExclude = msg.Config.HeadersExclude
log.Debugf("configured base maildir: %s", dir)
return nil
}
@@ -620,6 +624,12 @@ func (w *Worker) handleFetchMessageHeaders(
w.worker.PostMessageInfoError(msg, uid, err)
continue
}
+ 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.worker.PostMessage(&types.MessageInfo{
Message: types.RespondTo(msg),
Info: info,