aboutsummaryrefslogtreecommitdiffstats
path: root/worker/maildir/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/maildir/worker.go')
-rw-r--r--worker/maildir/worker.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index a671d730..2f75f12a 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -1,9 +1,11 @@
package maildir
import (
+ "bytes"
"errors"
"fmt"
"io"
+ "io/ioutil"
"net/url"
"os"
"path/filepath"
@@ -433,11 +435,15 @@ func (w *Worker) handleFetchFullMessages(msg *types.FetchFullMessages) error {
return err
}
defer r.Close()
+ b, err := ioutil.ReadAll(r)
+ if err != nil {
+ return err
+ }
w.worker.PostMessage(&types.FullMessage{
Message: types.RespondTo(msg),
Content: &models.FullMessage{
Uid: uid,
- Reader: r,
+ Reader: bytes.NewReader(b),
},
}, nil)
}