Add rspamd symbol descriptions from embedded/API lookup

Embed rspamd-symbols.json in the binary to provide human-readable
descriptions for rspamd symbols in reports. Optionally fetch fresh
symbols from a configurable rspamd API URL (--rspamd-api-url flag),
falling back to the embedded list on error. Update the frontend to
display descriptions alongside symbol names and scores.
This commit is contained in:
nemunaire 2026-03-26 09:25:42 +07:00
commit 7d3009d7d0
12 changed files with 6816 additions and 20 deletions

View file

@ -30,7 +30,7 @@ import (
)
func TestAnalyzeRspamdNoHeaders(t *testing.T) {
analyzer := NewRspamdAnalyzer()
analyzer := NewRspamdAnalyzer(nil)
email := &EmailMessage{Header: make(mail.Header)}
result := analyzer.AnalyzeRspamd(email)
@ -126,7 +126,7 @@ func TestParseSpamdResult(t *testing.T) {
},
}
analyzer := NewRspamdAnalyzer()
analyzer := NewRspamdAnalyzer(nil)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -241,7 +241,7 @@ func TestAnalyzeRspamd(t *testing.T) {
},
}
analyzer := NewRspamdAnalyzer()
analyzer := NewRspamdAnalyzer(nil)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -340,7 +340,7 @@ func TestCalculateRspamdScore(t *testing.T) {
},
}
analyzer := NewRspamdAnalyzer()
analyzer := NewRspamdAnalyzer(nil)
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -380,7 +380,7 @@ func TestAnalyzeRspamdRealEmail(t *testing.T) {
t.Fatalf("Failed to parse email: %v", err)
}
analyzer := NewRspamdAnalyzer()
analyzer := NewRspamdAnalyzer(nil)
result := analyzer.AnalyzeRspamd(email)
if result == nil {