mirror of
https://github.com/ProtonMail/proton-bridge.git
synced 2025-12-10 12:46:46 +00:00
fix: pubkey should not be collected as attachment
This commit is contained in:
@ -44,12 +44,6 @@ func Parse(r io.Reader, key, keyName string) (m *pmapi.Message, mimeBody, plainB
|
||||
return
|
||||
}
|
||||
|
||||
if key != "" {
|
||||
if err = attachPublicKey(p.Root(), key, keyName); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
m = pmapi.NewMessage()
|
||||
|
||||
if err = parseMessageHeader(m, p.Root().Header); err != nil {
|
||||
@ -68,6 +62,15 @@ func Parse(r io.Reader, key, keyName string) (m *pmapi.Message, mimeBody, plainB
|
||||
return
|
||||
}
|
||||
|
||||
// We only attach the public key manually to the MIME body for
|
||||
// signed/encrypted external recipients. It's not important for it to be
|
||||
// collected as an attachment; that's already done when we upload the draft.
|
||||
if key != "" {
|
||||
if err = attachPublicKey(p.Root(), key, keyName); err != nil {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
mimeBodyBuffer := new(bytes.Buffer)
|
||||
|
||||
if err = p.NewWriter().Write(mimeBodyBuffer); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user