Details
-
Bug
-
Resolution: Fixed
-
Low
-
2.0.2
Description
JIRA errors out when you are trying to add a mail server that only has CRAM-MD5 and DIGEST-MD5 as login methods:
DEBUG: JavaMail version 1.4.5 DEBUG: successfully loaded resource: /META-INF/javamail.default.providers DEBUG: Tables of loaded providers DEBUG: Providers Listed By Class Name: {com.sun.mail.smtp.SMTPSSLTransport=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc], com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc]} DEBUG: Providers Listed By Protocol: {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc], imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Sun Microsystems, Inc], smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc], pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Sun Microsystems, Inc], pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Sun Microsystems, Inc], smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Sun Microsystems, Inc]} DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map DEBUG: getProvider() returning javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Sun Microsystems, Inc] DEBUG: mail.imap.fetchsize: 16384 DEBUG: mail.imap.statuscachetimeout: 1000 DEBUG: mail.imap.appendbuffersize: -1 DEBUG: mail.imap.minidletime: 10 DEBUG: disable AUTH=PLAIN DEBUG: trying to connect to host "imap.someniceandsecurehost.com", port 993, isSSL true * OK [CAPABILITY IMAP4rev1 LITERAL+ SASL-IR LOGIN-REFERRALS ID ENABLE IDLE LOGINDISABLED XAPPLEPUSHSERVICE AUTH=CRAM-MD5 AUTH=DIGEST-MD5 AUTH=GSSAPI] Dovecot ready. DEBUG IMAP: AUTH: CRAM-MD5 DEBUG IMAP: AUTH: DIGEST-MD5 DEBUG IMAP: AUTH: GSSAPI DEBUG: protocolConnect login, host=imap.someniceandsecurehost.com, user=username, password=<non-null> 2014-09-19 15:29:34,940 http-bio-8080-exec-14 ERROR user 929x97x1 asd1fb 192.168.3.234 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [servicedesk.squalor.email.MailServerVerifier] Unable to connect to the server at intranet.druide.com due to the following exception: Unfortunately JIRA Service Desk couldn't connect to the mail server. Here is what the mail server said: "No login methods supported!"
After some troubleshooting, I've found that since JavaMail fully supports SASL, it should have support for the two login methods mentioned. And adding: {{ -Dmail.imap.sasl.mechanisms=CRAM-MD5 -Dmail.imap.sasl.enable=true}} we are able to create a normal JIRA Incoming Mail account and configure a e-mail handler.
However if you try to create the E-mail Service on Service Desk, you are unable to get past the first screen when configuring the mail server settings and the following exception is added to the logs:
2014-10-08 16:45:50,785 http-bio-8080-exec-11 ERROR username 1005x101x1 1asx2asy 192.158.4.123 /rest/servicedesk/1/servicedesk/SI/incomingemail/validateemailforcreation [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: javax/security/sasl/SaslException java.lang.NoClassDefFoundError: javax/security/sasl/SaslException at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source) at com.sun.mail.imap.protocol.IMAPProtocol.sasllogin(IMAPProtocol.java:701) at com.sun.mail.imap.IMAPStore.login(IMAPStore.java:716) at com.sun.mail.imap.IMAPStore.protocolConnect(IMAPStore.java:648) at javax.mail.Service.connect(Service.java:295) at com.atlassian.servicedesk.squalor.email.MailServerVerifier.verifyMailServer(MailServerVerifier.java:38) ... Caused by: java.lang.ClassNotFoundException: javax.security.sasl.SaslException at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:772) at org.apache.felix.framework.ModuleImpl.access$200(ModuleImpl.java:73) at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1690) at java.lang.ClassLoader.loadClass(Unknown Source)