mirror of
https://github.com/nodemailer/wildduck.git
synced 2024-12-27 10:21:11 +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 {
|
try {
|
||||||
let { data } = await this.addMessage(messageOpts);
|
let { data } = await this.addMessage(messageOpts);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
filterResults.push({
|
filterResults.push({
|
||||||
mailbox: data.mailbox && data.mailbox.toString(),
|
mailbox: data.mailbox && data.mailbox.toString(),
|
||||||
|
@ -711,7 +710,14 @@ class FilterHandler {
|
||||||
userData,
|
userData,
|
||||||
response: 'Message stored as ' + data.id.toString(),
|
response: 'Message stored as ' + data.id.toString(),
|
||||||
filterResults,
|
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:
|
prepared:
|
||||||
(!isEncrypted && {
|
(!isEncrypted && {
|
||||||
|
|
Loading…
Reference in a new issue