Files
ports/mail/sendmail/files/patch-srvrsmtp.c
Dirk Meyer 54ac934cb1 - extend blacklisting
- cleanup rsa glue
2018-12-30 14:04:19 +00:00

44 lines
1.3 KiB
C

--- sendmail/srvrsmtp.c.orig 2015-03-18 11:47:12 UTC
+++ sendmail/srvrsmtp.c
@@ -1328,6 +1328,7 @@ smtp(nullserver, d_flags, e)
(int) tp.tv_sec +
(tp.tv_usec >= 500000 ? 1 : 0)
);
+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "pre-greeting traffic");
}
}
}
@@ -1721,8 +1722,11 @@ smtp(nullserver, d_flags, e)
}
else
{
+ int fd;
/* not SASL_OK or SASL_CONT */
message("535 5.7.0 authentication failed");
+ fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL);
+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "AUTH FAIL");
if (LogLevel > 9)
sm_syslog(LOG_WARNING, e->e_id,
"AUTH failure (%s): %s (%d) %s, relay=%.100s",
@@ -1867,6 +1871,9 @@ smtp(nullserver, d_flags, e)
DELAY_CONN("AUTH");
if (!sasl_ok || n_mechs <= 0)
{
+ int fd;
+ fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL);
+ BLACKLIST_NOTIFY(BLACKLIST_AUTH_FAIL, fd, "AUTH LOGIN FAIL");
message("503 5.3.3 AUTH not available");
break;
}
@@ -3523,7 +3530,10 @@ doquit:
#if MAXBADCOMMANDS > 0
if (++n_badcmds > MAXBADCOMMANDS)
{
+ int fd;
stopattack:
+ fd = sm_io_getinfo(InChannel, SM_IO_WHAT_FD, NULL);
+ BLACKLIST_NOTIFY(BLACKLIST_ABUSIVE_BEHAVIOR, fd, "too many bad commands");
message("421 4.7.0 %s Too many bad commands; closing connection",
MyHostName);