...
Import the SSL certificate from Gmail:
For Windows: double-click the openssl file from the directory that gets installed. Run
Code Block |
---|
s_client -connect smtp.gmail.com:465
|
For Linux: run:
Code Block |
---|
openssl s_client -connect smtp.gmail.com:465
|
Exit the openssl prompt, and return to your Java installation's bin
directory. Import the cert into your keystore:
Tip |
---|
"A keystore is created whenever you use a -genkey, -import, or -identitydb command to add data to a keystore that doesn't yet exist. More specifically, if you specify, in the -keystore option, a keystore that doesn't yet exist, that keystore will be created. If you don't specify a -keystore option, the default keystore is a file named .keystore in your home directory. If that file does not yet exist, it will be created." |
For Windows:
Code Block |
---|
keytool -import -alias smtp.gmail.com -keystore $JAVA"%JAVA_HOMEHOME%/jre/lib/security/cacerts" -file C:\path\to\gmail.cert |
Fore Linux:
Code Block |
---|
sudo keytool -import -alias smtp.gmail.com -keystore $JAVA_HOME/jre/lib/security/cacerts -file /path/to/gmail.cert
|
Tip |
---|
The default keystore password is 'changeit'. |
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. For example:
Code Block | ||||
---|---|---|---|---|
| ||||
mv <JIRA-INSTALL>/WEB-INF/lib/activation-1.1.1.jar lib/; mv <JIRA-INSTALL>/WEB-INF/lib/mail-1.4.1.jar lib/ |
Add Gmail as a JNDI Resource in /conf/server.xml in-between JIRA's <Context>...</Context> ( after line 49 ). Change your username and password:
Code Block | ||||
---|---|---|---|---|
| ||||
<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"
/>
|
Restart JIRA so that the above changes are picked up by JIRA. Then, configure the SMTP server in JIRA's interface, use the JNDI setting. The proper value (if using the default example), is:
Code Block | ||||
---|---|---|---|---|
| ||||
java:comp/env/mail/GmailSmtpServer
|
...