diff options
author | Ben Burwell <ben@benburwell.com> | 2019-08-07 22:21:19 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2019-08-08 12:50:54 +0900 |
commit | a1749411e61d20f701442c9c7e58464f4e0203b8 (patch) | |
tree | 7e365051b8c144c1c933edcd4198947bf9b20e1d /worker/maildir | |
parent | 072b5f453ccb8c3d79f55be80f5db9e71cf17a31 (diff) | |
download | aerc-a1749411e61d20f701442c9c7e58464f4e0203b8.tar.gz |
maildir: Preserve flags when copying messages
Diffstat (limited to 'worker/maildir')
-rw-r--r-- | worker/maildir/container.go | 22 |
1 files changed, 2 insertions, 20 deletions
diff --git a/worker/maildir/container.go b/worker/maildir/container.go index f0151810..85e892a8 100644 --- a/worker/maildir/container.go +++ b/worker/maildir/container.go @@ -2,7 +2,6 @@ package maildir import ( "fmt" - "io" "io/ioutil" "log" "path/filepath" @@ -121,23 +120,6 @@ func (c *Container) copyMessage( if !ok { return fmt.Errorf("could not find key for message id %d", uid) } - - f, err := src.Open(key) - if err != nil { - return fmt.Errorf("could not open source message: %v", err) - } - - del, err := dest.NewDelivery() - if err != nil { - return fmt.Errorf("could not initialize delivery: %v", err) - } - defer del.Close() - - if _, err = io.Copy(del, f); err != nil { - return fmt.Errorf("could not copy message to delivery: %v", err) - } - - // TODO: preserve flags - - return nil + _, err := src.Copy(dest, key) + return err } |