Skip to content

Commit

Permalink
fix: do not rate limit our own servers
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism committed Sep 29, 2023
1 parent 7347e93 commit b7b00d3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion smtp-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,12 @@ async function onAuth(auth, session, fn) {
//
// only rate limit if the domain has_smtp
//
if (domain.has_smtp) {
if (
domain.has_smtp &&
// do not rate limit IP addresses corresponding to our servers
(!session.resolvedClientHostname ||
parseRootDomain(session.resolvedClientHostname) !== env.WEB_HOST)
) {
// rate limit to X failed attempts per day by IP address
const limit = await this.rateLimiter.get({
id: session.remoteAddress,
Expand Down

0 comments on commit b7b00d3

Please sign in to comment.