james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Commented] (MIME4J-265) Possible wrong calculation of header length
Date Mon, 08 Jan 2018 10:37:01 GMT

    [ https://issues.apache.org/jira/browse/MIME4J-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16316054#comment-16316054
] 

Oleg Kalnichevski commented on MIME4J-265:
------------------------------------------

bq. What is misleading is that maxHeaderLength is the total length of a header (and not of
a line).

Hence max _header_ length and not max line length

bq. The point IMHO is exactly that one, for what I know there is no overall header limit,
the only limit is on the single line

The MIME specification intentionally does not impose any specific limits on MIME message elements
and leaves it up to implementations to decide what is deemed safe in their specific contexts.

Oleg 

> Possible wrong calculation of header length
> -------------------------------------------
>
>                 Key: MIME4J-265
>                 URL: https://issues.apache.org/jira/browse/MIME4J-265
>             Project: James Mime4j
>          Issue Type: Bug
>    Affects Versions: 0.7.2
>            Reporter: Raffaele Gambelli
>              Labels: headers
>
> I've implemented a sort of mail server and I have many threads listening for incoming
emails.
> I'm using mime4j to parse javamail Message.
> I had only one case of:
> Caused by: org.apache.james.mime4j.io.MaxHeaderLengthLimitException: Maximum header length
limit exceeded
>  at org.apache.james.mime4j.stream.DefaultFieldBuilder.append(DefaultFieldBuilder.java:63)
>         at org.apache.james.mime4j.stream.MimeEntity.readRawField(MimeEntity.java:212)
>         at org.apache.james.mime4j.stream.MimeEntity.nextField(MimeEntity.java:258)
> Looking at the code of DefaultFieldBuilder, it seems that the check over line length
is not done on the single line but on the overall header, I'm refering to this line:
> {code:java}
> if (this.maxlen > 0 && this.buf.length() + len >= this.maxlen) {
> {code}
> Why should you add "this.buf.length" ?
> I know that there is no limit on header length, but only in its lines.
> I can't attach my eml for privacy reasons but I can confirm that I have no too much long
line
> Thanks



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message