#12: implement Antispam & Antivirus scanning pipeline (Rspamd & ClamAV)
This commit is contained in:
1 parent
4c2e0b9563
commit
54d1ea5810
15 files changed
+825
-5
No files matched your search
@@ -0,0 +1,38 @@
|
||||
package valueobject
|
||||
|
||||
type ScanVerdict string
|
||||
|
||||
const (
|
||||
ScanVerdictClean ScanVerdict = "CLEAN"
|
||||
ScanVerdictSpamJunk ScanVerdict = "SPAM_JUNK"
|
||||
ScanVerdictSpamReject ScanVerdict = "SPAM_REJECT"
|
||||
ScanVerdictGreylist ScanVerdict = "GREYLIST"
|
||||
ScanVerdictVirusReject ScanVerdict = "VIRUS_REJECT"
|
||||
)
|
||||
|
||||
type ScanResult struct {
|
||||
Verdict ScanVerdict
|
||||
Score float64
|
||||
RequiredScore float64
|
||||
Action string
|
||||
VirusName string
|
||||
Symbols map[string]float64
|
||||
HeadersToAdd map[string]string
|
||||
}
|
||||
|
||||
func NewCleanScanResult() *ScanResult {
|
||||
return &ScanResult{
|
||||
Verdict: ScanVerdictClean,
|
||||
Symbols: make(map[string]float64),
|
||||
HeadersToAdd: make(map[string]string),
|
||||
}
|
||||
}
|
||||
|
||||
func NewVirusScanResult(virusName string) *ScanResult {
|
||||
return &ScanResult{
|
||||
Verdict: ScanVerdictVirusReject,
|
||||
VirusName: virusName,
|
||||
Symbols: make(map[string]float64),
|
||||
HeadersToAdd: make(map[string]string),
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user