Add grades
This commit is contained in:
parent
33d394a27b
commit
a64b866cfa
25 changed files with 362 additions and 207 deletions
|
|
@ -240,13 +240,14 @@ func (r *RBLChecker) reverseIP(ipStr string) string {
|
|||
}
|
||||
|
||||
// CalculateRBLScore calculates the blacklist contribution to deliverability
|
||||
func (r *RBLChecker) CalculateRBLScore(results *RBLResults) int {
|
||||
func (r *RBLChecker) CalculateRBLScore(results *RBLResults) (int, string) {
|
||||
if results == nil || len(results.IPsChecked) == 0 {
|
||||
// No IPs to check, give benefit of doubt
|
||||
return 100
|
||||
return 100, ""
|
||||
}
|
||||
|
||||
return 100 - results.ListedCount*100/len(r.RBLs)
|
||||
percentage := 100 - results.ListedCount*100/len(r.RBLs)
|
||||
return percentage, ScoreToGrade(percentage)
|
||||
}
|
||||
|
||||
// GetUniqueListedIPs returns a list of unique IPs that are listed on at least one RBL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue