Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-18379

camel-mail: attachments with empty fileName

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.24.3, 3.18.0
    • 3.14.5, 3.18.2, 3.19.0
    • camel-mail
    • None
    • camel 2.24.3 on karaf 4.2.7, openjdk 11.0.15

    • Novice

    Description

      camel-mail cannot consume mails having attachment with empty fileName, for example :

      ------=_Part_16671_1906075314.1659698158276
      Content-Type: image/png; name=""
      Content-Disposition: inline; filename=""

      ...

       

      this mail produces the following error:
      Caused by: java.lang.IllegalArgumentException: name must be specified and not empty
      at org.apache.camel.util.StringHelper.notEmpty(StringHelper.java:335) ~[!/:2.24.3]
      at org.apache.camel.component.mail.DelegatingDataSource.<init>(DelegatingDataSource.java:35) ~[!/:2.24.3]

      ...

      proposition: implement same behavior as attachment with no fileName, ie attachment is ignored.

       

      workaround: use mapMailMessage=false option on camel source endpoint, so email is polled without error.

      then, in a Processor, on exchange object, overload binding class with custom "MailBinding" before reading attachments:
      exchange.setProperty(Exchange.BINDING,new NoInlineMailBinding());

       

       

      Attachments

        1. test-camel-mail-inline.zip
          3 kB
          Richard Vigniel

        Activity

          People

            davsclaus Claus Ibsen
            rvigniel Richard Vigniel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: