From mime4j-dev-return-2332-archive-asf-public=cust-asf.ponee.io@james.apache.org Mon Jan 8 10:30:30 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id 023E8180607 for ; Mon, 8 Jan 2018 10:30:30 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E6811160C3E; Mon, 8 Jan 2018 09:30:29 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 2DD44160C1E for ; Mon, 8 Jan 2018 10:30:29 +0100 (CET) Received: (qmail 61454 invoked by uid 500); 8 Jan 2018 09:30:28 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 61421 invoked by uid 99); 8 Jan 2018 09:30:27 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Jan 2018 09:30:27 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 54A1E18079A for ; Mon, 8 Jan 2018 09:30:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.009 X-Spam-Level: * X-Spam-Status: No, score=1.009 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RCVD_IN_DNSWL_LOW=-0.7, SPF_FAIL=0.919, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id SEWuvUsuQ6W1 for ; Mon, 8 Jan 2018 09:30:25 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id D5D6A62735 for ; Mon, 8 Jan 2018 09:22:20 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 2E5D3E25C9 for ; Mon, 8 Jan 2018 09:22:20 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 281132411F for ; Mon, 8 Jan 2018 08:43:00 +0000 (UTC) Date: Mon, 8 Jan 2018 08:43:00 +0000 (UTC) From: "Raffaele Gambelli (JIRA)" To: mime4j-dev@james.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MIME4J-265) Possible wrong calculation of header length MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-265?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16315879#comment-16315879 ] Raffaele Gambelli commented on MIME4J-265: ------------------------------------------ {quote}What is misleading is that maxHeaderLength is the total length of a header (and not of a line).{quote} 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, read for example [here|http://support.everycloudtech.com/support/solutions/articles/4000070246-rfc-2822-line-limits-applicable-for-mime-body-line-limits-] > 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)