Issue #139 detect Rspamd X-Virus

This commit is contained in:
djmaze 2021-09-03 08:21:51 +02:00
parent 33b7546e9c
commit d71b36f09e
3 changed files with 9 additions and 4 deletions

View file

@ -157,10 +157,11 @@ class MailClient
// SPAM // SPAM
\MailSo\Mime\Enumerations\Header::X_SPAM_STATUS, \MailSo\Mime\Enumerations\Header::X_SPAM_STATUS,
\MailSo\Mime\Enumerations\Header::X_SPAMD_RESULT, \MailSo\Mime\Enumerations\Header::X_SPAMD_RESULT,
\MailSo\Mime\Enumerations\Header::X_BOGOSITY \MailSo\Mime\Enumerations\Header::X_BOGOSITY,
// Virus // Virus
,\MailSo\Mime\Enumerations\Header::X_VIRUS_SCANNED, \MailSo\Mime\Enumerations\Header::X_VIRUS,
,\MailSo\Mime\Enumerations\Header::X_VIRUS_STATUS \MailSo\Mime\Enumerations\Header::X_VIRUS_SCANNED,
\MailSo\Mime\Enumerations\Header::X_VIRUS_STATUS
), true); ), true);
// //
// return \MailSo\Imap\Enumerations\FetchType::ENVELOPE; // return \MailSo\Imap\Enumerations\FetchType::ENVELOPE;

View file

@ -479,6 +479,9 @@ class Message implements \JsonSerializable
$this->bIsSpam = false !== \stripos($spam, 'YES'); $this->bIsSpam = false !== \stripos($spam, 'YES');
} }
if ($virus = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_VIRUS)) {
$this->bHasVirus = true;
}
if ($virus = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_VIRUS_STATUS)) { if ($virus = $oHeaders->ValueByName(\MailSo\Mime\Enumerations\Header::X_VIRUS_STATUS)) {
if (false !== \stripos($spam, 'infected')) { if (false !== \stripos($spam, 'infected')) {
$this->bHasVirus = true; $this->bHasVirus = true;

View file

@ -70,7 +70,8 @@ abstract class Header
X_HAM_REPORT = 'X-Ham-Report', X_HAM_REPORT = 'X-Ham-Report',
X_MICROSOFT_ANTISPAM = 'x-microsoft-antispam', X_MICROSOFT_ANTISPAM = 'x-microsoft-antispam',
// X-Quarantine-ID // X_QUARANTINE_ID = 'X-Quarantine-ID',
// Rspamd
X_VIRUS = 'X-Virus', X_VIRUS = 'X-Virus',
// ClamAV // ClamAV
X_VIRUS_SCANNED = 'X-Virus-Scanned', X_VIRUS_SCANNED = 'X-Virus-Scanned',