Skip to content

Commit

Permalink
Merge pull request #46 from omar-polo/link-auth
Browse files Browse the repository at this point in the history
change linkAuth for the 0.7 protocol version
  • Loading branch information
poolpOrg authored Jun 14, 2023
2 parents e445b19 + aec872d commit 9e74486
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions filter-rspamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,24 @@ func linkIdentify(s *session, params []string) {
}

func linkAuth(s *session, params []string) {
if len(params) != 2 {
if len(params) < 2 {
log.Fatal("invalid input, shouldn't happen")
}
if params[1] != "pass" {

var user, res string
if version < "0.7" {
res = params[len(params) - 1]
user = strings.Join(params[0:len(params)-1], "|")
} else {
res = params[0]
user = strings.Join(params[1:], "|")
}

if res != "pass" {
return
}

s.userName = params[0]
s.userName = user
}

func txReset(s *session, params []string) {
Expand Down

0 comments on commit 9e74486

Please sign in to comment.