Wednesday, May 13, 2009

Configuring Jira to use Gmail via SMTP

Here is the notes from work to setup SMTP for Jira on Windows:

  1. Download openssl
  2. Run: openssl s_client -connect smtp.gmail.com:465> gmail.pem
  3. Edit gmail.pem with notepad
  4. Remove everything exception of "-----BEGIN CERTIFICATE-----" to "-----END CERTIFICATE-----" (the BEGIN and END portion must be retained)
  5. Save it
  6. Run: keytool -import -file gmail.pem -alias smtp.gmail.com -keystore "C:\Program Files\Java\jre1.6.0_05\lib\security\cacerts"
  7. keytool comes with Java in the bin dir
  8. lib\security\cacerts is within the Java install dir
  9. Edit C:\Program Files\JIRA-Enterprise-3.13.4\conf\server.xml
  10. Obviously file is relative to your install
  11. Add the below node to Context element but change relevant settings:
  12. <resource name="mail/GmailSmtpServer" class="Apple-tab-span" style="white-space:pre"> auth="Container"
    type="javax.mail.Session"
    mail.smtp.host="smtp.gmail.com"
    mail.smtp.port="465"
    mail.smtp.auth="true"
    mail.smtp.user="MyGmailAccount@gmail.com"
    password="MyPassword"
    mail.smtp.starttls.enable="true
    mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory" 
    />
  13. Save file
  14. Move 
  15. Files:
  16. javamail-1.3.3.jar
  17. activation-1.0.2.jar
  18. From: c:\Program Files\JIRA-Enterprise-3.13.4\atlassian-jira\WEB-INF\lib\
  19. To: c:\Program Files\JIRA-Enterprise-3.13.4\common\lib
  20. Restart Atlassian JIRA service
  21. Go to Adminstration in JIRA web
  22. Go to Mail Servers
  23. Configure the SMTP
  24. Use JNDI setting: java:comp/env/mail/GmailSmtpServer
  25. Pray to God it works!

References:

2 comments:

iunknwn said...

At step 6, password is "changeit".

Peter Bodde said...

JIRA is almost like an API. JIRA can service PHP and JAVA for SMTP.
anti spam service

There was an error in this gadget