Import encrypted messages as is

This commit is contained in:
Michal Horejsek
2020-11-19 12:30:09 +01:00
parent f96cd167ef
commit ca962ce5ad
18 changed files with 289 additions and 25 deletions

View File

@ -67,6 +67,14 @@ func (req *ImportReq) WriteTo(w *multipart.Writer) (err error) {
if _, err = fw.Write(msg.Body); err != nil {
return
}
// Adding new line to properly fetch the whole body on the API side.
// The reason is the bug in PHP: https://bugs.php.net/bug.php?id=75923
// Messages generated by PM already have it but importing already
// encrypted messages might not have it.
if _, err = fw.Write([]byte("\r\n")); err != nil {
return
}
}
return err