forked from trumail/trumail
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding more blacklist rules and error checking
- Loading branch information
Showing
6 changed files
with
61 additions
and
57 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,9 +15,10 @@ import ( | |
func (v *Verifier) Blacklisted() error { | ||
var g errgroup.Group | ||
g.Go(func() error { return v.dnsBlacklisted(blacklists) }) | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "proofpoint") }) | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "cloudmark") }) | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "trend micro rbl") }) | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "proofpoint") }) // Proofpoint | ||
// g.Go(func() error { return v.matchBlacklisted("[email protected]", "outlook.com") }) // Outlook | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "cloudmark") }) // Cloudmark | ||
g.Go(func() error { return v.matchBlacklisted("[email protected]", "trend micro rbl") }) // Trend Micro RBL+ | ||
return g.Wait() | ||
} | ||
|
||
|
@@ -55,7 +56,7 @@ func (v *Verifier) matchBlacklisted(email, selector string) error { | |
// Perform a lookup on the email | ||
if _, err := v.Verify(email); err != nil { | ||
// If the error confirms we are blocked with the selector | ||
le := parseRCPTErr(err) | ||
le := parseSMTPError(err) | ||
if le != nil && le.Message == ErrBlocked && | ||
insContains(le.Details, selector) { | ||
return errors.New("Blocked by " + selector) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters