Documentation for JIRA 4.1. Documentation for other versions of JIRA is available too.

This page describes how to use Gmail for both SMTP and POP3 mail.

Configuring GMail for Outgoing Mail (SMTP)

Follow the instructions from Configuring JIRA to Send SMTP Mail:

  1. Download OpenSSL:
    Linux: http://www.openssl.org/
    Windows: http://gnuwin32.sourceforge.net/packages/openssl.htm
  2. Import the SSL certificate from Gmail:
    For Windows: double-click the openssl file from the directory that gets installed. Run
     s_client -connect smtp.gmail.com:465
    
    For Linux: run:
     openssl s_client -connect smtp.gmail.com:465
    
  3. Copy the results into a file called gmail.cert. You want only the alphanumeric string between BEGIN CERT and END CERT (inclusive).
  4. Exit the openssl prompt, and return to your Java installation's bin directory. Import the cert into your keystore:
    For Windows:
    keytool -import -alias smtp.gmail.com -keystore C:\path\to\keystore -file C:\path\to\gmail.cert
    
    Fore Linux:
    sudo keytool -import -alias smtp.gmail.com -keystore $JAVA_HOME/jre/lib/security/cacerts -file /path/to/gmail.cert
    

    The default keystore password is 'changeit'.

  5. Move ( not copy! ) the activation and mail jar files from the /WEB-INF/lib folder to the /common/lib (Tomcat 5.5) or /lib (Tomcat 6) folder.
  6. Add Gmail as a JNDI Resource in /conf/server.xml in-between JIRA's <Context>...</Context> ( after line 49 ). Change your username and password:
    <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"
    />
    
  7. Configure the SMTP server in JIRA's interface, use the JNDI setting. The proper value (if using the default example), is:
    java:comp/env/mail/GmailSmtpServer
    

Configuring GMail for Incoming Mail (POP)

To use Gmail, for example, as a create and comment mail handler:

  1. If you did not import the SSL certificate from Gmail for the SMTP server, refer to the instructions above.
  2. Enable POP access in GMail's settings
  3. Add a POP3 mail account
  • ラベルなし