Start bad spam score to B
This commit is contained in:
parent
9970e957d5
commit
255027d00b
3 changed files with 26 additions and 4 deletions
|
|
@ -214,7 +214,7 @@ func (a *SpamAssassinAnalyzer) CalculateSpamAssassinScore(result *api.SpamAssass
|
|||
return 0, "F" // Failed spam test
|
||||
} else {
|
||||
// Linear scale between 0 and required threshold
|
||||
percentage := 100 - int(math.Round(float64(score*100/result.RequiredScore)))
|
||||
return percentage, ScoreToGrade(percentage - 15)
|
||||
percentage := 100 - int(math.Round(float64(score*100/(2*result.RequiredScore))))
|
||||
return percentage, ScoreToGrade(percentage - 5)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -181,7 +181,7 @@ func TestGetSpamAssassinScore(t *testing.T) {
|
|||
Score: 2.0,
|
||||
RequiredScore: 5.0,
|
||||
},
|
||||
expectedScore: 60, // 100 - round(2*100/5) = 100 - 40 = 60
|
||||
expectedScore: 80, // 100 - round(2*100/5) = 100 - 40 = 60
|
||||
},
|
||||
{
|
||||
name: "Score at threshold",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue