Replace Q_ENUMS with individual Q_ENUM#186
Conversation
…njection. Added replacing naked LFs and CRs with CRLF to be compliant with SMTP standard (RFC 5321). In SmtpClient.h, replace Q_ENUMS with individual Q_ENUM, added string() function for enum types.
MAde QRegularExpressions static.
Made names more expressive.
|
Hi @Edward-LeBlanc! 🙂 I would say sanitizing user input should be done in the application code, not by the library. Content wise MIME allows sending basically anything. You just need to change the default For headers you can use Thx! |
|
I was trying to not repeat code, but I respect your decision. I had already changed the encoding to Base64 in my project, but I apparently missed a couple places that are now fixed. That, of course, is the problem with duplicated code in legacy projects. What do you think about the part in SmtpClient.h: "replace Q_ENUMS with individual Q_ENUM, added string() function for enum types”? The result of this is seeing the enum names instead of the numeric values in debug and log messages. If you are OK with that, I would revert the other changes. |
|
The enum change can remain, it makes perfect sense. Thx! |
Added sanitizing header fields (remove \r, \n) preventing malicious injection.
Added replacing naked LFs and CRs with CRLF to be compliant with SMTP standard (RFC 5321).
In SmtpClient.h, replace Q_ENUMS with individual Q_ENUM so that debugging prints names instead of numerical values, added string() function for enum types.
Tested with strict SMTP server.