james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wiederkehr <markus.wiederk...@gmail.com>
Subject Re: Address list parser expects unfolded field body. Does that make sense?
Date Fri, 27 Nov 2009 18:58:12 GMT
On Fri, Nov 27, 2009 at 2:37 PM, Oleg Kalnichevski <olegk@apache.org> wrote:
> Oleg Kalnichevski wrote:
>> Markus et al
>> The address list parser currently chokes on folded field values that are
>> otherwise perfectly valid. That seems somewhat illogical to me. It really
>> took me a while to figure out what was wrong with the address list until I
>> stumbled upon a commend about the parser expecting unfolded fields. The very
>> cryptic exception message did not really help either.
>> What is the reason for this restriction? It is because folded values are
>> difficult to parse with jjtree? Should not we unfold field values
>> automatically prior to feeding them to the parser?

As for the reason, I don't know, that was before my time..

>> Oleg
> DelegatingFieldParser#parse method does not automatically unfold the field
> body, which actually seems like a bug to me. What is the expected behavior
> of this method?

>From what I see the unfolding happens in
AbstractField.parse(ByteSequence, String) at line 155. The call
hierarchy leads to AbstractField.parse(ByteSequence) and

I guess you should use AbstractField.parse(ByteSequence).


View raw message