Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iterator in max_recipients (introduced in 2c5fdd49) #63

Merged
merged 1 commit into from
Jun 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
this.penalize(connection, true, 'Too many errors', next)
}

exports.max_recipients = function (next, connection, params) {

Check warning on line 133 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'params' is defined but never used
if (!this.cfg.recipients) return next() // disabled in config

const max = this.get_limit('recipients', connection)
Expand Down Expand Up @@ -511,7 +511,7 @@

let connections_in_ttl_period = 0
for (const ts of Object.keys(tstamps)) {
if (parseInt(ts, 10) < periodStartTs) return // older than ttl
if (parseInt(ts, 10) < periodStartTs) continue // older than ttl
connections_in_ttl_period =
connections_in_ttl_period + parseInt(tstamps[ts], 10)
}
Expand All @@ -530,7 +530,7 @@
}
}

exports.rate_rcpt_sender = async function (next, connection, params) {

Check warning on line 533 in index.js

View workflow job for this annotation

GitHub Actions / lint / lint

'params' is defined but never used
const [key, value] = this.get_mail_key(
'rate_rcpt_sender',
connection.transaction.mail_from,
Expand Down
Loading