maildir: Preserve flags when copying messages
This commit is contained in:
parent
072b5f453c
commit
a1749411e6
1 changed files with 2 additions and 20 deletions
|
@ -2,7 +2,6 @@ package maildir
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
@ -121,23 +120,6 @@ func (c *Container) copyMessage(
|
||||||
if !ok {
|
if !ok {
|
||||||
return fmt.Errorf("could not find key for message id %d", uid)
|
return fmt.Errorf("could not find key for message id %d", uid)
|
||||||
}
|
}
|
||||||
|
_, err := src.Copy(dest, key)
|
||||||
f, err := src.Open(key)
|
return err
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue