Commons Email
  1. Commons Email
  2. EMAIL-124

Header values are folded twice and thus creating defective emails

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Blocker Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: 1.3.1
    • Labels:
      None

      Description

      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.

        Activity

        Hide
        Thomas Neidhart added a comment -

        Fixed in r1448617.

        Thanks for the report and analysis, we will try to push a 1.3.1 bugfix release for it.

        Show
        Thomas Neidhart added a comment - Fixed in r1448617. Thanks for the report and analysis, we will try to push a 1.3.1 bugfix release for it.
        Hide
        Thomas Neidhart added a comment -

        Can you check with the latest trunk version if the problem is solved for you?
        I will then start a release tomorrow.

        Thanks,

        Thomas

        Show
        Thomas Neidhart added a comment - Can you check with the latest trunk version if the problem is solved for you? I will then start a release tomorrow. Thanks, Thomas
        Hide
        Stefan Schueffler added a comment -

        Hi,

        due to my vacational out of office, i unfortunately can not test your commit. But as far as i can tell from reading your commit mentioned above, your fix looks exactly the same what i did while analyzing this issue.

        Regards,

        Stefan

        Show
        Stefan Schueffler added a comment - Hi, due to my vacational out of office, i unfortunately can not test your commit. But as far as i can tell from reading your commit mentioned above, your fix looks exactly the same what i did while analyzing this issue. Regards, Stefan

          People

          • Assignee:
            Unassigned
            Reporter:
            Stefan Schueffler
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development