Mail server at location is not of required type javax.mail.Session
This article only applies to Atlassian's server products. Learn more about the differences between cloud and server.
The following error is displayed when adding a JNDI setting to an email server (especially if you are connecting your instance to Gmail). This is also commonly seen after an upgrade if you had JNDI configured for your email server.
The following appears in the atlassian-confluence.log:
An error has occurred with sending the test email: java.lang.IllegalArgumentException: Mail server at location [java:comp/env/mail/GmailSMTPServer] is not of required type javax.mail.Session.
As explained on Setting Up a Mail Session for the Confluence Distribution, you need to ensure that you move (don't copy)
<confluence-install>\lib (x.x.x. represents the version numbers on the jar files in your installation).
Don't leave a renamed backup of the jar files in
\confluence\WEB-INF\lib. Even with a different file name, the files will still be loaded as long as it remains in the directory.
Removing the duplicate file should solve the problem.
- Shutdown Confluence
- Delete the
- Restart Confluence and attempt to reconfigure your mail server again.