Skip to content

Commit

Permalink
Merge pull request #7 from whataboutpereira/go-linter-cleanup
Browse files Browse the repository at this point in the history
Remove underscores from variable names.
  • Loading branch information
poolpOrg authored Sep 20, 2019
2 parents 9f5a3cd + 1168cf0 commit fd7973c
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions filter-rspamd.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ type session struct {
mtaName string

msgid string
mail_from string
rcpt_to []string
mailFrom string
rcptTo []string
message []string

action string
Expand Down Expand Up @@ -136,8 +136,8 @@ func txReset(sessionId string, params []string) {

s := sessions[sessionId]
s.msgid = ""
s.mail_from = ""
s.rcpt_to = nil
s.mailFrom = ""
s.rcptTo = nil
s.message = nil
s.action = ""
sessions[s.id] = s
Expand All @@ -163,7 +163,7 @@ func txMail(sessionId string, params []string) {
}

s := sessions[sessionId]
s.mail_from = params[1]
s.mailFrom = params[1]
sessions[s.id] = s
}

Expand All @@ -177,7 +177,7 @@ func txRcpt(sessionId string, params []string) {
}

s := sessions[sessionId]
s.rcpt_to = append(s.rcpt_to, params[1])
s.rcptTo = append(s.rcptTo, params[1])
sessions[s.id] = s
}

Expand Down Expand Up @@ -206,7 +206,6 @@ func dataCommit(sessionId string, params []string) {
s := sessions[sessionId]
sessions[sessionId] = s


switch s.action {
case "reject":
if( s.response == "") {
Expand Down Expand Up @@ -271,14 +270,14 @@ func rspamdQuery(s session, token string) {
req.Header.Add("Helo", s.heloName)
req.Header.Add("MTA-Name", s.mtaName)
req.Header.Add("Queue-Id", s.msgid)
req.Header.Add("From", s.mail_from)
req.Header.Add("From", s.mailFrom)

if s.userName != "" {
req.Header.Add("User", s.userName)
}

for _, rcpt_to := range s.rcpt_to {
req.Header.Add("Rcpt", rcpt_to)
for _, rcptTo := range s.rcptTo {
req.Header.Add("Rcpt", rcptTo)
}

resp, err := client.Do(req)
Expand Down

0 comments on commit fd7973c

Please sign in to comment.