Commit 4edcd79a authored by Alberto Bertogli's avatar Alberto Bertogli

smtpsrv: Keep reading DATA input even if it's too large

When the DATA input is too large, we should keep on reading through it
until we reach the end marker, otherwise there is a security problem:
the remaining data will be interpreted as SMTP commands, so for example
a forwarded message that is too long might end up executing SMTP
commands under an authenticated user.

This patch implements this behaviour, while being careful not to consume
extra memory to avoid opening up the possibility of a DoS.

Note the equivalent logic for single long lines is already implemented.
parent 28cb9169
Pipeline #100463310 passed with stages
in 8 minutes and 23 seconds