mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-26 09:50:47 +08:00
Include attachment sha256 in the filtering response
This commit is contained in:
parent
e8b2667533
commit
734b0134d6
1 changed files with 8 additions and 2 deletions
|
@ -697,7 +697,6 @@ class FilterHandler {
|
|||
|
||||
try {
|
||||
let { data } = await this.addMessage(messageOpts);
|
||||
|
||||
if (data) {
|
||||
filterResults.push({
|
||||
mailbox: data.mailbox && data.mailbox.toString(),
|
||||
|
@ -711,7 +710,14 @@ class FilterHandler {
|
|||
userData,
|
||||
response: 'Message stored as ' + data.id.toString(),
|
||||
filterResults,
|
||||
attachments: (maildata && maildata.attachments) || []
|
||||
attachments: [].concat((maildata && maildata.attachments) || []).map(att => {
|
||||
let binaryHash = prepared.mimeTree?.attachmentMap?.[att.id];
|
||||
let resp = Object.assign({}, att); // cheap copy
|
||||
if (binaryHash) {
|
||||
resp.encodedSha256 = binaryHash.toString('base64');
|
||||
}
|
||||
return resp;
|
||||
})
|
||||
},
|
||||
prepared:
|
||||
(!isEncrypted && {
|
||||
|
|
Loading…
Reference in a new issue