On Fri, Dec 12, 2008 at 10:21 AM, Stefano Bagnara <[email protected]> wrote:
> Markus Wiederkehr ha scritto:
>> I have written a new Base64OutputStream for Mime4j. According to my
>> tests it is about twice as fast as the current one (when fed with 1024
>> byte blocks).
>
> Good!
>
>> It also resolves a tiny issue: the current implementation still
>> appends _two_ CRLFs at the end of the encoded data if the input data
>> size is a multiple of 57 bytes.
>
> The number of ending CRLF in quoted-printable and base64 encoded parts
> always puzzled me. I never found a clear explanation in the RFC about
> what CRLF have to be added and what not. :-(

As far as I understand the RFC it should not matter, at least not in
the base64 case. RFC 2045 states that "Any characters outside of the
base64 alphabet are to be ignored in base64-encoded data."

So whether a base64 encoded block is terminated with one or ten CRLFs
should not matter at all because the decoder is supposed to ignore
CRLF entirely.

Unfortunately I have a use case where things are different: applying
an explicit S/MIME signature. Certain e-mail clients from a certain
company are a bit picky when verifying such signatures. They expect
exactly one empty line between a base64 block and the following
message boundary. Otherwise the signature is considered to be broken
even if it is not (which can be confirmed by using a decent MUA).

>> But now what? Is this a case of review-then-commit or
>> commit-then-review? Do I have to file a JIRA? Or may I just make use
>> of my new "karma"?
>
> We run all of james product with CTR (commit then review). For stable
> branches and for code that you are not confident with, and anytime you
> feel it better, it is suggested the use of RTC (in this case I'd use CTR).
>
> For most task we are used creating a JIRA issue when we're working on
> the issue: this let people know what you are doing and also allow easy
> tracking (also historical) of the change.
>
> About this specific commit you can reuse (reopen)
> https://issues.apache.org/jira/browse/MIME4J-71 or at least reference
> also it.
>
> As Norman suggested if you use the jira issue name (e.g: MIME4J-71) in
> the commit comment text the whole commit will appear in the "Subversion
> Commits" tab in the JIRA issue (few minutes later).

Thanks for the explanation. I'll reopen #71 as you suggested.

Markus

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to