mirror of
https://github.com/mjl-/mox.git
synced 2024-12-28 09:23:47 +03:00
in smtpserver, don't put unrecognized smtp commands in prometheus metrics
can blow up prometheus storage.
This commit is contained in:
parent
f5af258075
commit
19b819d222
1 changed files with 1 additions and 1 deletions
|
@ -719,6 +719,7 @@ func command(c *conn) {
|
||||||
p := newParser(args, c.smtputf8, c)
|
p := newParser(args, c.smtputf8, c)
|
||||||
fn, ok := commands[cmdl]
|
fn, ok := commands[cmdl]
|
||||||
if !ok {
|
if !ok {
|
||||||
|
c.cmd = "(unknown)"
|
||||||
if c.ncmds == 0 {
|
if c.ncmds == 0 {
|
||||||
// Other side is likely speaking something else than SMTP, send error message and
|
// Other side is likely speaking something else than SMTP, send error message and
|
||||||
// stop processing because there is a good chance whatever they sent has multiple
|
// stop processing because there is a good chance whatever they sent has multiple
|
||||||
|
@ -726,7 +727,6 @@ func command(c *conn) {
|
||||||
c.writecodeline(smtp.C500BadSyntax, smtp.SeProto5Syntax2, "please try again speaking smtp", nil)
|
c.writecodeline(smtp.C500BadSyntax, smtp.SeProto5Syntax2, "please try again speaking smtp", nil)
|
||||||
panic(errIO)
|
panic(errIO)
|
||||||
}
|
}
|
||||||
c.cmd = "(unknown)"
|
|
||||||
// note: not "command not implemented", see ../rfc/5321:2934 ../rfc/5321:2539
|
// note: not "command not implemented", see ../rfc/5321:2934 ../rfc/5321:2539
|
||||||
xsmtpUserErrorf(smtp.C500BadSyntax, smtp.SeProto5BadCmdOrSeq1, "unknown command")
|
xsmtpUserErrorf(smtp.C500BadSyntax, smtp.SeProto5BadCmdOrSeq1, "unknown command")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue