mirror of
https://blitiri.com.ar/repos/chasquid
synced 2025-12-17 14:37:02 +00:00
smtpsrv: Quote unknown commands for debugging
When we receive unknown commands, we use the first 6 bytes for troubleshooting (e.g. put them in traces and exported metrics). While this is safe, since the different places know how to quote them properly, it makes things more difficult to analyse, since it's not uncommon to see be binary blobs. This patch makes us use the ascii-quoted version instead, to make things easier to analyze.
This commit is contained in:
@@ -278,7 +278,7 @@ loop:
|
||||
default:
|
||||
// Sanitize it a bit to avoid filling the logs and events with
|
||||
// noisy data. Keep the first 6 bytes for debugging.
|
||||
cmd = fmt.Sprintf("unknown<%.6s>", cmd)
|
||||
cmd = fmt.Sprintf("unknown<%.6q>", cmd)
|
||||
code = 500
|
||||
msg = "5.5.1 Unknown command"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user