Using Gmail as a JIRA Mail Server
This article applies to JIRA versions 4.3 and below. For all other versions, please refer to Configuring JIRA's SMTP Mail Server to Send Notifications
This page describes how to use a Gmail account as either an SMTP mail server to send notifications from JIRA or a POP3 mail server to receive email messages that create JIRA issues or comments, or both.
Configuring JIRA to use Gmail as an SMTP mail server
- Shut down JIRA.
Move (not copy) the 'activation' and 'mail' JAR files from the from the
<jira-application-dir>/WEB-INF/lib/
subdirectory of the JIRA Installation Directory to the/common/lib
(Tomcat 5.5) or/lib
(Tomcat 6) subdirectory of the JIRA Installation Directory (for 'recommended' distributions of JIRA) or thelib/
subdirectory of the application server running JIRA.
For example, on a *nix-based system, at a shell prompt, change directory into the JIRA Installation Directory (of a 'recommended' distribution of JIRA) and enter the following:mv atlassian-jira/WEB-INF/lib/activation-1.1.1.jar lib/; mv atlassian-jira/WEB-INF/lib/mail-1.4.5.jar lib/
Add Gmail as a JNDI resource within the within the
<Context/>
elements of the/conf/server.xml
file. Change your username and password to those required to authenticate against your Gmail account:<Resource name="mail/GmailSmtpServer" auth="Container" type="javax.mail.Session" mail.smtp.host="smtp.gmail.com" mail.smtp.port="465" mail.smtp.auth="true" mail.smtp.user="myusername@gmail.com" password="mypassword" mail.smtp.starttls.enable="true" mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" />
If you are not using the built in cacerts file, you will need to add Gmail as a secure server. (Most default configurations can skip this step).
Restart JIRA so that JIRA will acknowledge the JNDI location you defined above.
Follow the instructions in Configuring JIRA's SMTP Mail Server to Send Notifications to configure JIRA's SMTP mail server and at the second part of the configuration, specify in the JNDI Location field (if using the default example above):
java:comp/env/mail/GmailSmtpServer
Configuring Gmail for Incoming Mail (POP)
To use Gmail, for example, as a create and comment mail handler:
If you did not import the SSL certificate from Gmail during configuration of Gmail as an SMTP mail server, refer to the instructions above.
Enable POP access in your Gmail account's settings.
Add a POP3 mail account in JIRA.