Skip to content

Commit

Permalink
maxrcpt: if DISABLE_MAXRCPT is defined it skips the check
Browse files Browse the repository at this point in the history
maxrcpt: error code changed to 452 due to RFC 4.5.3.1 (was 553). If DISABLE_MAXRCPT is defined it skips the check, otherwise outgoing messages from mailing lists would be rejected.
  • Loading branch information
sagredo-dev committed Jun 8, 2024
1 parent 9db1ac4 commit 87fac63
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ This distribution of qmail puts together netqmail-1.06 with the following patche
https://nvd.nist.gov/vuln/detail/CVE-2023-51765). Enable bare LF by defining ALLOW_BARELF in tcprules.
* Michael Samuel's maxrcpt patch
allows you to set a limit on how many recipients are specified for any one email message by setting
control/maxrcpt. RFC 2821 section 4.5.3.1 says that an MTA MUST allow at least 100 recipients for each
message, since this is one of the favourite tricks of the spammer.
control/maxrcpt. [RFC 2821 section 4.5.3.1](https://datatracker.ietf.org/doc/html/rfc2821#section-4.5.3.1)
says that an MTA MUST allow at least 100 recipients for each message, since this is one of the favourite
tricks of the spammer. If DISABLE_MAXRCPT is defined it skips the check, as outgoing messages from mailing
lists would be rejected otherwise.
https://notes.sagredo.eu/files/qmail/patches/maxrcpt.patch
* Inter7's qmail-eMPF patch
More info: https://notes.sagredo.eu/files/qmail/patches/empf.README
Expand Down
5 changes: 3 additions & 2 deletions qmail-smtpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ char *arg;
/* rbl: end */
void err_maxrcpt()
{
out("553 max rcpt limit exceeded (#5.7.1)\r\n");
qlogenvelope("rejected","max_rcpt_exceeded","","553");
out("452 max rcpt limit exceeded (#5.7.1)\r\n");
qlogenvelope("rejected","max_rcpt_exceeded","","452");
flush();
}
void straynewline() { qlogenvelope("rejected","bad_newlines","","451"); out("451 See http://pobox.com/~djb/docs/smtplf.html.\r\n"); flush(); _exit(1); }
Expand Down Expand Up @@ -1056,6 +1056,7 @@ int addrvalid()
/* rcptcheck: end */

int checkrcptcount() {
if (env_get("DISABLE_MAXRCPT")) return 0;
if (maxrcpt == -1) {return 0;}
else if (rcptcount > maxrcpt) {return 1;}
else {return 0;}
Expand Down

0 comments on commit 87fac63

Please sign in to comment.