As discussed in #219 the preferred way is to fix the Encoder instead of Replacing it in the SMTP Client.
This PR implements the required changes in the Encoder.
The BareLF check is implemented as Wiser MessageHandler (as it was in #220)
The error mainly occures in the header-section, so the test will set Subject, From and To to verify correct handling.
Due to the changes in the Encoder, the MailEncoderTest has to be fixed, consider that \r\n is only introduced in length dependent breaking of the encoded words in Utils.java. The encoded mail as EncodedPart will be concatenated by \n in MailEncoder.encode()MailEncoder.java#L104-L106 (only used in tests) and EncodedPart.java#L35-L45
Motivation:
fixes https://github.com/vert-x3/vertx-mail-client/issues/219 SMTP Smuggling problems
Replaces #220
Implementation Detail:
As discussed in #219 the preferred way is to fix the Encoder instead of Replacing it in the SMTP Client. This PR implements the required changes in the Encoder.
The BareLF check is implemented as Wiser MessageHandler (as it was in #220)
The error mainly occures in the header-section, so the test will set
Subject
,From
andTo
to verify correct handling.Due to the changes in the Encoder, the MailEncoderTest has to be fixed, consider that
\r\n
is only introduced in length dependent breaking of the encoded words in Utils.java. The encoded mail asEncodedPart
will be concatenated by\n
inMailEncoder.encode()
MailEncoder.java#L104-L106 (only used in tests) and EncodedPart.java#L35-L45