Using Gmail as JIRA mail server error

Hi Jobin,

yes I am behind a firewall but it can be done. ()

I summarize what I did - maybe it has to extend with sg.

1. I moved the 'activation' and 'mail' JAR files from the from the <jira-application-dir>/WEB-INF/lib/ to C:\Program Files\Atlassian\JIRA\lib

maybe it can be wrong but based on the documentation I couldn't identify which is actually the Jira installation dir.

2. I added Gmail as a JNDI resource within the within the <Context/> elements of the /conf/server.xml file.

3. I set 2 things in the setenv.bat file:

* I put this line: set JVM_PROXY=-Dhttp.proxyHost=proxy.xxx.xxx.xxx.de -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts="127.0.0.1|*.xxx.xx"

* And I added to JAVA_OPTS this: %JVM_PROXY%

I didn't do this OPENSSL step because I didn't understand at all.

I attach a picture of the settings in the Outgoing Mail section and my setenv.bat file. Can you please check whether I pasted the proxy settings in a wrong place in the setenv.

Thanks in advance!

Rumi

5 answers

1 accepted

This widget could not be displayed.
Exactly, 465 is for SSL whereas 587 is TLS

Hi GCM and Norman,

do you mean it will work inside of firewall with SMTP Port: 587?

Rumi

What we are saying you need to specify the correct combination of parameters to get email to work. In the image below where you had TLS checked, you need to use port 587.

Yes, gmail communication behind a firewall is possible. but you need to

1) configure Jira for email access correctly.

https://confluence.atlassian.com/display/JIRA/Using+Gmail+as+a+JIRA+Mail+Server

2) Use the correct set of parameters for your email service

(See the comments on the above url about certificates and the url below

http://support.google.com/mail/bin/answer.py?hl=en&answer=78775

3) Configure your firewall(s) to allow email communications.

See your network administrator or see the person who configures your firewall(s) or call your firewall vendor to get some help on configuration.

Rumceisz, If I misspoke for you, I apologize.

What we are saying you need to specify the correct combination of parameters to get email to work. In the image below where you had TLS checked, you need to use port 587.

Yes, gmail communication behind a firewall is possible. but you need to

1) configure Jira for email access correctly.

https://confluence.atlassian.com/display/JIRA/Using+Gmail+as+a+JIRA+Mail+Server

2) Use the correct set of parameters for your email service

(See the comments on the above url about certificates and the url below

http://support.google.com/mail/bin/answer.py?hl=en&answer=78775

3) Configure your firewall(s) to allow email communications.

See your network administrator or see the person who configures your firewall(s) or call your firewall vendor to get some help on configuration.

GCM, If I misspoke for you, I apologize.

This widget could not be displayed.

I got this:

Caused by: java.lang.NoClassDefFoundError: javax/mail/Authenticator
	at org.apache.naming.factory.MailSessionFactory.getObjectInstance(MailSessionFactory.java:105)
	at org.apache.naming.factory.ResourceFactory.getObjectInstance(ResourceFactory.java:140)
	at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:304)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:793)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:140)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:781)
	at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
	at org.apache.naming.SelectorContext.lookup(SelectorContext.java:152)
	at javax.naming.InitialContext.lookup(InitialContext.java:392)
	at com.atlassian.mail.server.impl.SMTPMailServerImpl.getJndiSession(SMTPMailServerImpl.java:141)
	at com.atlassian.mail.server.impl.SMTPMailServerImpl.getSession(SMTPMailServerImpl.java:112)
	at com.atlassian.jira.plugins.mail.webwork.VerifySmtpServerConnection$VerifySmptServer.verifyMailServer(VerifySmtpServerConnection.java:156)
	at com.atlassian.jira.plugins.mail.webwork.VerifySmtpServerConnection.validateServer(VerifySmtpServerConnection.java:47)
	at com.atlassian.jira.plugins.mail.webwork.VerifySmtpServerConnection.doExecute(VerifySmtpServerConnection.java:95)
	at com.atlassian.jira.plugins.mail.webwork.VerifySmtpServerConnection.doVerification(VerifySmtpServerConnection.java:112)
	at com.atlassian.jira.plugins.mail.webwork.VerifySmtpServerConnection.doAdd(VerifySmtpServerConnection.java:103)
	... 135 more
Caused by: java.lang.ClassNotFoundException: javax.mail.Authenticator
	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
	... 155 more

See here https://confluence.atlassian.com/display/CROWD/Configuring+your+Mail+Server

If you have something like this

<Resource name="mail/YahooSmtpServer"

auth="Container"

type="javax.mail.Session"

mail.smtp.host="smtp.bizmail.yahoo.com"

mail.smtp.port="587"

mail.smtp.auth="true"

mail.smtp.user="xxx"

password="xxx"

mail.debug="true"

/>

In your server.xml, quoting:

You will also need to ensure that the JavaMail classes and Java Beans Activation Framework are present in your application server's classpath.

This is, to copy activation-1.0.2.jar and mail-1.4.1.jar from tomcat/confluence/WEB-INF/lib to tomcat/lib/

This widget could not be displayed.

Are you sure all the parameters are right? If so, is it blocked in firewall?

Here are the excerpts from my setenv.bat file:

IF "x%JIRA_HOME%x" == "xx" GOTO NOJIRAHOME2
echo Using JIRA_HOME: %JIRA_HOME%
:NOJIRAHOME2

set JVM_PROXY=-Dhttp.proxyHost=proxy.xxx.xxx.xxx.xx -Dhttp.proxyPort=3128 -Dhttp.nonProxyHosts="127.0.0.1|*.xxx.xx"

and:

set JAVA_OPTS=%JAVA_OPTS% -Xms%JVM_MINIMUM_MEMORY% -Xmx%JVM_MAXIMUM_MEMORY% %JVM_REQUIRED_ARGS% %DISABLE_NOTIFICATIONS% %JVM_SUPPORT_RECOMMENDED_ARGS% %JVM_EXTRA_ARGS% %JIRA_HOME_MINUSD%JVM_PROXY%

Have you tried SMTP settings instead of JNDI?

You don't need to open it. Make sure the TLS option is checked. Can you post a screenshot?

Not yet, I check.

It doesn't work either.

Do I have to open this 465 port? Never done it before.

I checked but it doesn't work.

I could only attach the screen as an answer sorry

Well, that should normally work. It is time to call the network guys. I am guessing a firewall rule..

Hi Jobin,

the connection works from outside of the company network, so the problem is related to the firewall.

I summarize the correct gmail settings (outside of firewall) for the users meeting this problem in the future:

* From address: gmail email address

* Protocol: SMTP

* Host name: LEAVE BLANK!

* SMTP Port: 25

* TLS: checked

* JNDI Location: java:comp/env/mail/GmailSmtpServer

Set setenv.bat and server.xml

This widget could not be displayed.

Hi All,

I got the following error after Jira reinstall:

Unfortunately no connection was possible. Review the errors below and rectify:

  • NameNotFoundException: Name mail is not bound in this Context

And I also get:

Oops - an error has occurred

System Error

A system error has occurred.

Please try submitting this problem via the Support Request Page
Otherwise, please create a support issue on our support system at http://support.atlassian.com with the following information:

  1. a description of your problem
  2. cut & paste the error and system information found below
  3. attach the application server log file ( C:\Program Files (x86)\Atlassian\Application Data\JIRA\log\atlassian-jira.log )

Cause:
java.lang.reflect.InvocationTargetException

This widget could not be displayed.

With TLS set, try port 587 instead of port 465 or uncheck TLS if you do not need it and then use port 465.

Suggest an answer

Log in or Sign up to answer
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Posted 45m ago in Canada

Topic Tuesday - August 21

Hello and happy Topic Tuesday! We would love to continue to find out more about you. Here’s the question: What is one way Atlassian products have shifted the way your team works? Looking forw...

10 views 2 0
View post

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you