Handle message hasVirus header in JavaScript

This commit is contained in:
the-djmaze 2024-01-22 13:33:00 +01:00
parent e133cf5ffb
commit f0bb3a8a45
2 changed files with 17 additions and 27 deletions

View file

@ -257,13 +257,28 @@ export class MessageModel extends AbstractModel {
}
// Unsubscribe links
value = headers.valueByName('List-Unsubscribe');
if (value) {
if (value = headers.valueByName('List-Unsubscribe')) {
this.unsubsribeLinks(value.split(',').map(
link => link.replace(/^[ <>]+|[ <>]+$/g, '')
));
}
if (headers.valueByName('X-Virus')) {
this.hasVirus(true);
}
if (value = headers.valueByName('X-Virus-Status')) {
if (value.includes('infected')) {
this.hasVirus(true);
} else if (value.includes('clean')) {
this.hasVirus(false);
}
}
/*
if (value = headers.valueByName('X-Virus-Scanned')) {
this.virusScanned(value);
}
*/
return true;
}
}