Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-15580

MailHandler deletes message that should be ignored due to catchmail parameter

    XMLWordPrintable

Details

    Description

      If you have 2 mail handlers setup to check a single mailbox, with catchmail parameters such as this:

      • project=HLP, issuetype=3, catchemail=jira@example.com, createusers=true, notifyusers=false, ccassignee=false
      • project=HLP, issuetype=3, catchemail=geeks@example.com, createusers=true, notifyusers=false, ccassignee=false, stripquotes=true

      Then there's a bug if the mailhandler that doesn't match a mail's TO address runs first. It will delete the message from the mailbox, rather than keeping it, such that the other mailhandler can pick it up.

      This was introduced in 3.13, by the fingerprint checking code to prevent mail loops.

      The default behaviour of the fingerPrintCheck seems to be to set the deleteMail flag to true (even if the message doesn't contain a fingerprint yet). We either need to change this default to false, or set the deleteMail flag to false in the special check for the catchEmail property (see TODO):

      AbstractMessageHandler.java
       // if the recipient is specified, check it is present in the message and reject if not
              if ((catchEmail != null) && !MailUtils.hasRecipient(catchEmail, message))
              {
                  final Address[] addresses = message.getAllRecipients();
                  logCantHandleRecipients(addresses);
                  //TODO: ADD THIS
                  deleteMail = false;
                  return false;
              }
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              andreask@atlassian.com Andreas Knecht (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: