Skip to content

Commit

Permalink
Add back error return for GraylistAdd()
Browse files Browse the repository at this point in the history
Requested by @johanix.

Since we are now returning the error again we
also need to check it at the callsite.
  • Loading branch information
eest committed May 27, 2024
1 parent e78c1cc commit 64014c4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lists.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ func (td *TemData) GreylistingReport(name string) (bool, string) {

}

func (td *TemData) GreylistAdd(name, policy, source string) string {
func (td *TemData) GreylistAdd(name, policy, source string) (string, error) {
msg := fmt.Sprintf("Domain name \"%s\" added to RPZ source %s with policy %s", name, source, policy)
return msg
return msg, nil
}
5 changes: 4 additions & 1 deletion refreshengine.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,10 @@ func (td *TemData) RefreshEngine(conf *Config, stopch chan struct{}) {

// if the name isn't either whitelisted or blacklisted
if cmd.ListType == "greylist" {
td.GreylistAdd(cmd.Domain, cmd.Policy, cmd.RpzSource)
_, err := td.GreylistAdd(cmd.Domain, cmd.Policy, cmd.RpzSource)
if err != nil {
log.Printf("RefreshEngine: call to GreylistAdd() failed: %s", err)
}
resp.Msg = fmt.Sprintf("Domain name \"%s\" (policy %s) added to greylisting DB.",
cmd.Domain, cmd.Policy)
cmd.Result <- resp
Expand Down

0 comments on commit 64014c4

Please sign in to comment.