Like many settings in JIRA, you need to be a JIRA system administrator (the user created during the initial setup is a system administrator) to configure mail server details. Perform the following steps to manage the outgoing mail server:
There are two ways of adding an outgoing mail server in JIRA; both options have some common configuration parameters that you will need to fill in. The following table shows those parameters:
For the rest of the parameters, depending on which option you select to set up your mail server, you only need to fill in the ones that are appropriate.
The first option is to select from one of the built-in service providers and specify the mail server's details. For example, if you have an SMTP mail server running, you can select the Custom option from the Service Provider field and specify the host and port number. This is the approach most people will use, as it is simple and straightforward. With this approach, the administrator fills in the mail server's host information, such as the host name and port number:
The second option is to use JNDI. This approach is slightly more complicated as it requires configuration on the application server itself (which is different per application server), and sometimes requires a restart of the application server.
If you are using the standalone distribution, which uses Apache Tomcat, the JNDI location will be java:comp/env/mail/JiraMailServer
. You will also need to specify the mail server details as a JNDI resource in the server.xml
file in the JIRA_INSTALL/conf
directory.
A sample declaration for Apache Tomcat is shown in the following code snippet. You will need to substitute in the real values for some of the parameters in the code of your mail server's details:
<Resource name="mail/JiraMailServer" auth="Container" type="javax.mail.Session" mail.smtp.host="mail.server.host" mail.smtp.port="25" mail.transport.protocol="smtp" mail.smtp.auth="true" mail.smtp.user="username" password="password" />
You will need to restart JIRA after saving your changes to the server.xml
file.
If you are running a test or evaluation JIRA instance or testing changes to notification rules, you might not want to flood your users with test e-mails. The easiest way for you to disable all outgoing e-mails is by just clicking on the Disable Outgoing Mail button in the Outgoing Mail page. Once you are ready to send e-mails again, you can click on the Enable Outgoing Mail button.
To increase security, you can encrypt the communication between JIRA and your mail server if your mail server supports SSL. There are two steps involved in enabling SSL over SMTP in JIRA.
The first step is to import your mail server's SSL certificate into Java's trust store. You can do this with Java's keytool
utility. On a Windows machine, run the following command in a Command Prompt:
Keytool –import –alias mail.yourcompany.com –keystore $JAVA_HOME/jre/lib/security/cacerts –file yourcertificate
The second step is to configure your application server to use SSL for mail communication. The following declaration is for Apache Tomcat that is used by JIRA Standalone. We use the same configuration file and only need to add two additional parameters:
<Resource name="mail/JiraMailServer" auth="Container" type="javax.mail.Session" mail.smtp.host="mail.server.host" mail.smtp.port="25" mail.transport.protocol="smtp" mail.smtp.auth="true" mail.smtp.user="username" password="password" mail.smtp.atarttls.enabled="true" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />
Once you import your certificate and configure your mail server, you will have to restart JIRA.
It is always a good idea to send a test e-mail after you configure your SMTP mail server, to make sure the server is running and you have set it correctly in JIRA:
If everything is correct, you will see a confirmation message in the Mail log section and receive the e-mail in your inbox. If there are errors, such as mail server connection, then the Mail log section will display the problems. This is very useful when troubleshooting any problems with JIRA's connectivity with the SMTP server:
In the preceding screenshot, you can see the test e-mail delivery has failed, and the error is because JIRA was unable to connect to the configured SMTP server.
18.116.63.5