From: Christopher Faulet Date: Wed, 21 Sep 2022 12:42:47 +0000 (+0200) Subject: MINOR: smtpchk: Update expect rule to fully match replies to EHLO commands X-Git-Tag: v2.7-dev7~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ec1ffaed061cd3560934c7525b204dbca25ace3;p=thirdparty%2Fhaproxy.git MINOR: smtpchk: Update expect rule to fully match replies to EHLO commands The response to EHLO command is a multiline reply. However the corresponding expect rule only match on the first line. For now, it is not an issue. But to be able to send the QUIT command and gracefully close the connection, we must be sure to consume the full EHLO reply first. To do so, the regex has been updated to match all 2xx lines at a time. --- diff --git a/src/tcpcheck.c b/src/tcpcheck.c index fc5197d5a9..deb7445354 100644 --- a/src/tcpcheck.c +++ b/src/tcpcheck.c @@ -4344,8 +4344,7 @@ int proxy_parse_smtpchk_opt(char **args, int cur_arg, struct proxy *curpx, const chk->index = 3; LIST_APPEND(&rs->rules, &chk->list); - chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^2[0-9]{2}[- \r]", - "min-recv", "4", + chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rstring", "^(2[0-9]{2}-[^\r]*\r\n)*2[0-9]{2}[ \r]", "error-status", "L7STS", "on-error", "%[res.payload(4,0),ltrim(' '),cut_crlf]", "on-success", "%[res.payload(4,0),ltrim(' '),cut_crlf]",