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

Mail handler incorrectly matches inactive or deleted users email address when creating an issue


      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.


      1. The customer JIRA instance have two user account with same email address and one of them is inactive mode. But, JIRA mail handler not able to create an issue for the active user due of using the same email address as of inactive user.
      2. in JIRA Cloud, the Mail Handler is configured with a default reporter. There is a disabled user in the Database with the same email address as the sender. The issue is not created because the mail handler matches the disabled user in the database. This also happens with active users that don't have create issue permission and (New in 2016) JIRA Cloud Deleted users that have issues and remain hidden in the database.

      Steps to reproduce the problems:

      Scenario 1

      1. Create two user (A and B) with same email address.
      2. Deactivate user A.
      3. Send an email to the user B email address (which should be the same as A) and send to POP/IMAP server.
      4. It will get the following warning message from incoming mail log, please see:
        2013-05-20 15:52:00,382 WARN [test] QuartzWorker-0 ServiceRunner    test test[10001]: Reporter (testing) does not have permission to create an issue. Message rejected.
        2013-05-20 15:52:05,334 WARN [test] QuartzWorker-0 ServiceRunner    test test[10001]: Reporter (testing) does not have permission to create an issue. Message rejected.

      Scenario 2

      1. Remove application access for a user in JIRA. The user is now disabled.
      2. Send an email with that email address to a Mail Handler with a "Default Reporter"

      Expected behaviour

      JIRA creates issues because the user has an option to do so.

      Actual behaviour

      JIRA doesn't create any issues for the users that have an email address in the database and are either disabled, deleted or without permissions although the Mail Handler allows issue creation with default mail handler or there is another user with that email address.


      Re-enable users and give correct permissions for issue creation or trick JIRA by renaming users and email addresses:

      1) Enable inactive/deleted users
      Failing email addresses for users that were deleted can be manually re-created from the User Management.
      To detect failing emails: Set a "Forward Email" address in the mail handler to receive notifications when emails fail and then manually grant access to users so the email is processed.

      Manually fixing inactive and deleted users:
      Scenario 1) Check for duplicate email address:

      select lower_email_address from cwd_user group by lower_email_address having count(lower_email_address) > 1;

      Scenario 2) Find Deleted or disabled users:

      select user_name, first_name, last_name, display_name, email_address, active from cwd_user where active = 0 ;

      Steps for Cloud Support to mass re-enable deleted users:

      1. Export deleted users to .csv
        copy (SELECT user_name AS "Username", first_name AS "First Name", last_name AS "Last Name", user_name AS "Email Address", credential AS "Password" FROM cwd_user where active = 0 and display_name like '%[X]') to '/tmp/users-deleted.csv' csv header;
      2. Remove from the .csv the users that don't cause problems with the emails and don't need to be re-enabled.
      3. Use user-csv-importer to re-enable users.

      2) Assign correct permissions to users so they can create issues or Trick JIRA by changing user_name and email_address to a dummy address. Remember that the mail handler matches incoming emails to email_address and user_name.

            Unassigned Unassigned
            ckimloong John Chin
            77 Vote for this issue
            82 Start watching this issue