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

MailComponent 'peek' doesn't work due to programming error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 2.12.2
    • 2.11.5, 2.12.4, 2.13.0
    • camel-mail
    • None
    • Unknown

    Description

      The MailComponent peek setting doesn't work due to the following line:

          private void peekMessage(Message mail) {
              // this only applies to IMAP messages which has a setPeek method
              if (mail.getClass().getName().startsWith("IMAP")) {
                  try {
                      LOG.trace("Calling setPeek(true) on mail message {}", mail);
                      IntrospectionSupport.setProperty(mail, "peek", true);
                  } catch (Throwable e) {
                      // ignore
                      LOG.trace("Error setting peak property to true on: " + mail + ". This exception is ignored.", e);
                  }
              }
          }
      

      The line that checks the class name for IMAP should be using getSimpleName. Otherwise it's checking the package name instead.

      This effectively means that rollback of processing in camel mail is not supported.

      Attachments

        Activity

          People

            njiang Willem Jiang
            mattnathan Matt Nathan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: