Repository navigation
Add option for more relaxed barelf handling and changed softdeny to deny - #358
Conversation
…eny as this is a permanent error
|
Looks great. The only thing that gives me pause is the lazy option which seems like a potential foot gun. What do you think about removing the option and pointing at a URL (this issue?) that provides a patch for lazy handling, along with the usual "known smuggling vector, don't enable this on public facing servers, etc, etc" warnings? |
|
Thanks for looking into this! I was just afraid that the new behaviour may break some of our connections from non-RFC compliant communication partners. That's why I also thought about the lazy switch. For most cases the I'll update the PR as suggested. |
Yep, but I'd rather enshrine "just in case" in a comment and/or issue. We can always add it later if / when that use case surfaces. |
Definitely. Thanks for your constructive feedback as always! I'll remove the Draft state as soon, as I've removed the lazy option. |
Since #318 (1.02), any line in the DATA phase that doesn't end in CRLF is rejected, not only the final dot. That is RFC 5321 compliant, but it changed two things for operators:
cloud VMs, so the strict check is useful, but some operators need to accept mail from non-conforming legacy software.
Changes
-> strict (default): unchanged 1.02 semantics, any line not ending in CRLF is rejected.
-> tolerant: bare LF lines in the body are accepted, but the data only ends at .. A bare-LF/CR final dot, or a final dot directly after a bare LF (.), is still rejected, so the SMTP smuggling vectors stay closed.
-> lazy: the pre-1.02 behaviour (only the final dot is checked). It is documented as allowing . smuggling and is not recommended. It exists for operators who need an exact rollback.
Tests
t/qpsmtpd-smtp.t now expects 554 for the existing bare-LF cases. It also covers each mode against a bare LF in the body, a bare-LF final dot and the . smuggling sequence, plus the fallback for unknown values. Full suite passes.