Return-Path: X-Original-To: apmail-commons-issues-archive@minotaur.apache.org Delivered-To: apmail-commons-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 78133EA66 for ; Thu, 21 Feb 2013 10:46:15 +0000 (UTC) Received: (qmail 67356 invoked by uid 500); 21 Feb 2013 10:46:15 -0000 Delivered-To: apmail-commons-issues-archive@commons.apache.org Received: (qmail 67144 invoked by uid 500); 21 Feb 2013 10:46:14 -0000 Mailing-List: contact issues-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: issues@commons.apache.org Delivered-To: mailing list issues@commons.apache.org Received: (qmail 66587 invoked by uid 99); 21 Feb 2013 10:46:13 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 21 Feb 2013 10:46:13 +0000 Date: Thu, 21 Feb 2013 10:46:12 +0000 (UTC) From: "Stefan Schueffler (JIRA)" To: issues@commons.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (EMAIL-124) Header values are folded twice and thus creating defective emails MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Stefan Schueffler created EMAIL-124: --------------------------------------- Summary: Header values are folded twice and thus creating defective emails Key: EMAIL-124 URL: https://issues.apache.org/jira/browse/EMAIL-124 Project: Commons Email Issue Type: Bug Affects Versions: 1.3 Reporter: Stefan Schueffler Priority: Blocker With EMAIL-98, header values now are folded by commons-email. Unfortunately, they are folded twice: once in "Mail.addHeader" or "Mail.setHeaders", and once again in "Mail.buildMimeMessage()" while iterating over the headers. This results (in our test cases) in corrupted mail header lines having additional blank lines between the first and second line of a folded value - and thus ends in corrupted mails (as all headers after the first blank line are threatened as mail-body-content). As this renders "additional headers" useless in commons-mail and corrupts every mail having additionl headers with longer-than-folding-size values, i set the priority to blocker. The fix seems to be easy: just fold either in addHeader and setHeaders, or in buildMimeMessage (but not in both). My preferred solution would be to fold in buildMimeMessage, and to store the values "as-is" in addHeader and setHeaders so one is able to work with the plain values (if neccessary) until the mail is actually build and send. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira