Documentation for JIRA 5.2. Documentation for other versions of JIRA is available too.
JIRA can be configured to automatically create issues or comments on existing issues based on incoming messages received by a mail server or external mail service.
This is especially useful in a helpdesk or support scenario, where users send support queries via email that you wish to track with JIRA. Subsequent email messages about the issue (for example, responses to Email Notifications) can be automatically recorded as comments. Additionally, any attachments in the emails can automatically be attached to the issue (with appropriate configuration).
Issues and comments in JIRA can be generated either from:
To set up issue and comment creation from email, you will need to create a mail account for a POP or IMAP mail server that JIRA can access – typically, one mail account for each JIRA project. For example, for the 'ABC' project, you might establish an account abc-issues@example.com
JIRA will periodically scan for new email messages received by your mail account (via a service) and appropriately create issues or comments for any emails it finds (via a mail handler).
JIRA's mail handlers can also optionally create new user accounts for senders not previously seen. Note that this is not possible if you are using External User Management.
Once you have created a mail account on a POP or IMAP mail server, configure JIRA to receive email from that mail server account.
Tip: You can configure JIRA's mail servers so that recipients of email notifications can simply reply to these messages and have the body of their replies added as comments to the relevant issue. To do this, simply set the From address in JIRA's SMTP mail server to match that of the POP or IMAP mail server's account being monitored. In most cases, this means having JIRA's SMTP and POP or IMAP mail servers use the same mail account. Details on how to configure JIRA to handle these emailed replies is mentioned below.
To set up issue and comment creation from messages written to the file system by an external mail service, your external mail service must be able to write these messages within the import/mail
subdirectory of the JIRA Home Directory.
External mail services are very much like the POP or IMAP services above, except that instead of email messages being read from a mail account, they are read from a directory on the disk. External mail services are useful because they overcome the potential security risks associated with anonymous mail accounts. Instead you can simply configure your external mail service to dump incoming email messages within the JIRA Home Directory's import/mail
subdirectory, which is scanned periodically.
Please also be aware that JIRA expects only one message per file, so your external mail service should be configured to generate such output.
On this page:
Once you have configured JIRA to receive messages from a mail server/service, you configure JIRA to handle these messages through a 'mail handler'.
To configure a JIRA mail handler:
import/mail
subdirectory of the JIRA Home Directory, specify the subdirectory structure (within import/mail
) here. Please Note — the relationship between JIRA mail handlers and services:
JIRA provides the following default mail handlers:
For more information about how these mail handlers create issues and comments in JIRA, refer to Issue/comment creation (below).
Also refer to the Handy tips with mail handlers (below) for tips on tweaking mail handlers to allow JIRA to handle the following types of email messages:
This message handler creates a new issue, or adds a comment to an existing issue. If the subject contains an issue key, the message is added as a comment to that issue. If no issue key is found, a new issue is created in the default project.
To configure a 'Create a new issue or add a comment to an existing issue' mail handler:
On the Create a new issue or add a comment to an existing issue dialog box, complete the following fields/options:
Project | Specify the project key of the default project to which new issues are created by this handler — for example,
|
Issue Type | Choose the default issue type for new issues. |
Strip Quotes | Select this check box to remove quoted text from from an email message's body (e.g. from previous email replies) before the body's content is added to the JIRA issue's comment. |
Catch Email Address | If specified, only email messages whose To:, Cc:, Bcc: lines contain the recipient specified in this field will be processed — for example, Upon specifying an address here, all email messages whose To:, Cc:, Bcc: lines contain addresses other than the Catch Email Address are ignored. This is useful if you have multiple aliases for the same mail account (e.g.
|
Bulk | This option only affects 'bulk' email messages whose header has either its Precedence: field set to bulk or its Auto-Submitted field set to no. Such messages would typically be sent by an automated service. When such an email message is received, the following action will be performed, based on the option you choose:
It is generally a good idea to set bulk=forward and set a Forward Email address, to prevent mail loops between JIRA and another automated service (eg. another JIRA installation). |
Forward Email | If specified, then if this mail service is unable to handle an email message it receives, an email message indicating this problem will be forwarded to the email address specified in this field.
|
Create Users | Select this check box if you want JIRA to create new user accounts from any received email messages whose From: field contains an address that does not match one associated with an existing JIRA user account. This allows the creator of the email message to be notified of subsequent updates to the issue, which can be achieved by configuring the relevant project's notification scheme to notify the Reporter of updates. The username and email address of these newly created JIRA user accounts will be the email addresses specified in the From: fields of these received messages. The password for these new JIRA users is randomly generated and an email message is sent their addresses informing them about their new JIRA user account.
|
Default Reporter | Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as
|
Notify Users | Clear this check box if you do not want JIRA to send out an email message notifying users whose accounts have been created by the Create Users option above.
|
CC Assignee | Select this check box if you want JIRA to automatically assign the issue created to a JIRA user:
|
CC Watchers | Select this check box if you want JIRA to automatically add JIRA users to the issue created, where those users' email addresses (registered with their JIRA accounts) match addresses encountered in the To:, Cc: or Bcc: fields of the email message received.
|
This message handler creates a comment, but only uses the 'non quoted' lines of the body of the email message. A quoted line is any line that starts with a '>' or '|' symbol and such lines of text will not be added to the comment. The issue to which the comment is added is chosen from the first issue key found in the email subject. The author of the comment is taken from the address of the email message's From: field.
To configure an 'Add a comment from the non quoted email body' mail handler:
On the Create a new issue or add a comment to an existing issue dialog box, complete the following fields/options:
Catch Email Address | If specified, only email messages whose To:, Cc:, Bcc: lines contain the recipient specified in this field will be processed — for example, Upon specifying an address here, all email messages whose To:, Cc:, Bcc: lines contain addresses other than the Catch Email Address are ignored. This is useful if you have multiple aliases for the same mail account (e.g.
|
Bulk | This option only affects 'bulk' email messages whose header has either its Precedence: field set to bulk or its Auto-Submitted field set to no. Such messages would typically be sent by an automated service. When such an email message is received, the following action will be performed, based on the option you choose:
|
Forward Email | If specified, then if this mail service is unable to handle an email message it receives, an email message indicating this problem will be forwarded to the email address specified in this field.
|
Create Users | Select this check box if you want JIRA to create new user accounts from any received email messages whose From: field contains an address that does not match one associated with an existing JIRA user account. This allows the creator of the email message to be notified of subsequent updates to the issue, which can be achieved by configuring the relevant project's notification scheme to notify the Reporter of updates. The username and email address of these newly created JIRA user accounts will be the email address specified in the From: field of the message. The password for the new user is randomly generated, and an email is sent to the new user informing them about their new account in JIRA.
|
Default Reporter | Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as
|
Notify Users | Clear this check box if you do not want JIRA to send out an email message notifying users whose accounts have been created by the Create Users option above.
|
Test and save your mail handler (above).
This message handler creates a comment based on the entire body of the email message received. The issue to which the comment is added is chosen from the first issue key found in the email subject. The author of the comment is taken from the address of the email message's From: field.
To configure an 'Add a comment with the email body' mail handler:
On the Create a new issue or add a comment to an existing issue dialog box, complete the following fields/options:
Catch Email Address | If specified, only email messages whose To:, Cc:, Bcc: lines contain the recipient specified in this field will be processed — for example, Upon specifying an address here, all email messages whose To:, Cc:, Bcc: lines contain addresses other than the Catch Email Address are ignored. This is useful if you have multiple aliases for the same mail account (e.g.
|
Bulk | This option only affects 'bulk' email messages whose header has either its Precedence: field set to bulk or its Auto-Submitted field set to no. Such messages would typically be sent by an automated service. When such an email message is received, the following action will be performed, based on the option you choose:
|
Forward Email | If specified, then if this mail service is unable to handle an email message it receives, an email message indicating this problem will be forwarded to the email address specified in this field.
|
Create Users | Select this check box if you want JIRA to create new user accounts from any received email messages whose From: field contains an address that does not match one associated with an existing JIRA user account. This allows the creator of the email message to be notified of subsequent updates to the issue, which can be achieved by configuring the relevant project's notification scheme to notify the Reporter of updates. The username and email address of these newly created JIRA user accounts will be the email address specified in the From: field of the message. The password for the new user is randomly generated, and an email is sent to the new user informing them about their new account in JIRA.
|
Default Reporter | Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as
|
Notify Users | Clear this check box if you do not want JIRA to send out an email message notifying users whose accounts have been created by the Create Users option above.
|
This message handler creates a new issue for each incoming message.
To configure an 'Create a new issue from each email message' mail handler:
On the Create a new issue or add a comment to an existing issue dialog box, complete the following fields/options:
Project | Specify the project key of the default project to which new issues are created by this handler — for example,
|
Issue Type | Choose the default issue type for new issues. |
Catch Email Address | If specified, only email messages whose To:, Cc:, Bcc: lines contain the recipient specified in this field will be processed — for example, Upon specifying an address here, all email messages whose To:, Cc:, Bcc: lines contain addresses other than the Catch Email Address are ignored. This is useful if you have multiple aliases for the same mail account (e.g.
|
Bulk | This option only affects 'bulk' email messages whose header has either its Precedence: field set to bulk or its Auto-Submitted field set to no. Such messages would typically be sent by an automated service. When such an email message is received, the following action will be performed, based on the option you choose:
|
Forward Email | If specified, then if this mail service is unable to handle an email message it receives, an email message indicating this problem will be forwarded to the email address specified in this field.
|
Create Users | Select this check box if you want JIRA to create new user accounts from any received email messages whose From: field contains an address that does not match one associated with an existing JIRA user account. This allows the creator of the email message to be notified of subsequent updates to the issue, which can be achieved by configuring the relevant project's notification scheme to notify the Reporter of updates. The username and email address of these newly created JIRA user accounts will be the email address specified in the From: field of the message. The password for the new user is randomly generated, and an email is sent to the new user informing them about their new account in JIRA.
|
Default Reporter | Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as
|
Notify Users | Clear this check box if you do not want JIRA to send out an email message notifying users whose accounts have been created by the Create Users option above.
|
CC Assignee | Select this check box if you want JIRA to automatically assign the issue created to a JIRA user:
|
CC Watchers | Select this check box if you want JIRA to automatically add JIRA users to the issue created, where those users' email addresses (registered with their JIRA accounts) match addresses encountered in the To:, Cc: or Bcc: fields of the email message received.
|
This message handler creates a comment from the body of an email message - but ignores any part of the body past a marker or separator that matches a specified regular expression (regex).
For mail systems like Lotus Notes and Outlook, the core content of an email message is separated from other (e.g. replied or forwarded) content in the body by some predictable text string like '---- Original Message ----
' or 'Extranet\n email.address/DOM/REG/CONT/CORP@CORPMAIL
'. Hence, use this message handler, which can take any valid regex, to filter core from extraneous content from various different mail systems.
Also note that the issue to which the comment is added is chosen from the first issue key found in the email subject.
The Add a comment before a specified marker or separator in the email body mail handler has the following behaviour with respect to received email messages:
To configure an 'Add a comment before a specified marker or separator in the email body' mail handler:
On the Create a new issue or add a comment to an existing issue dialog box, complete the following fields/options:
Split Regex | Specify a regular expression matching the text that separates the content of the email message mail body from other (replied or forwarded) content in the body.
For example: /----\s*Original Message\s*----/ or /_____________*/ |
Catch Email Address | If specified, only email messages whose To:, Cc:, Bcc: lines contain the recipient specified in this field will be processed — for example, Upon specifying an address here, all email messages whose To:, Cc:, Bcc: lines contain addresses other than the Catch Email Address are ignored. This is useful if you have multiple aliases for the same mail account (e.g.
|
Bulk | This option only affects 'bulk' email messages whose header has either its Precedence: field set to bulk or its Auto-Submitted field set to no. Such messages would typically be sent by an automated service. When such an email message is received, the following action will be performed, based on the option you choose:
|
Forward Email | If specified, then if this mail service is unable to handle an email message it receives, an email message indicating this problem will be forwarded to the email address specified in this field.
|
Create Users | Select this check box if you want JIRA to create new user accounts from any received email messages whose From: field contains an address that does not match one associated with an existing JIRA user account. This allows the creator of the email message to be notified of subsequent updates to the issue, which can be achieved by configuring the relevant project's notification scheme to notify the Reporter of updates. The username and email address of these newly created JIRA user accounts will be the email address specified in the From: field of the message. The password for the new user is randomly generated, and an email is sent to the new user informing them about their new account in JIRA.
|
Default Reporter | Specify the username of a default reporter, which will be used if the email address in the From: field of any received messages does not match the address associated with that of an existing JIRA user — for example, a JIRA username such as
|
Notify Users | Clear this check box if you do not want JIRA to send out an email message notifying users whose accounts have been created by the Create Users option above.
|
You can design your own message handlers to better integrate your own processes into JIRA. Such custom mail handlers configured using the standard procedure above.
For more information about creating custom mail handlers, see Adding your own email handling classes.
The following points describe how JIRA processes each incoming email message and determines how its content gets added as either a comment to an existing issue or a new issue altogether.
For example, an email message to a mail account foo@example-co.com
on a POP or IMAP mail server configured against a JIRA server will be processed as follows:
Any attachments to the email will become attachments to the issue (assuming attachments have been enabled in JIRA).
To allow JIRA to handle email messages sent from people without a JIRA user account:
For JIRA production servers, we recommend that setting up the following email message pre-processing:
If your mail folder contains replies to JIRA's email notifications, set up rules that filter out auto-replies and bounces.
If you do not do this, there is a strong possibility of mail loops between JIRA and autoresponders like 'out of office' notifications. JIRA sets a 'Precedence:bulk' header (unless you have disabled this) and an 'Auto-Submitted' header on outgoing email, but some autoresponders ignore it.
There is no bulletproof way of detecting whether an email is a bounce or autoreply. The following rules (in procmail format) will detect most autoreplies:
^From:.*mailer-daemon@ ^Auto-Submitted:.auto- ^Content-Type:\ multipart/report;\ report-type=delivery-status ^Subject:\ Delivery\ Status\ Notification ^Subject:\ Undeliverable ^Subject: Returned Mail: ^From:\ System\ Administrator ^Precedence:\ auto_reply ^Subject:.*autoreply ^Subject:.*Account\ signup
Even with these rules, you may encounter autoreplies with nothing in the headers to distinguish it from a regular mail, In these cases you will just need to manually update the filters to exclude that sender.
JIRA's Logging & Profiling page has configuration options for Outgoing and Incoming mail.
Whenever you create a new (or edit an existing) mail handler (above), a Test button is available to allow you to test your mail handler's configuration to ensure it works as expected.
A useful tip for debugging mail-related problems in JIRA is to set the -Dmail.debug=true
property on startup. This will cause protocol-level details of JIRA's email interactions to be logged in catalina.out
(or standard output).
If you cannot resolve a problem yourself, please refer to the Getting Help page.