SMTP auth always fails

Thijs Baars August 17, 2014

In an earlier issue I found that the JRE that comes with Jira 6.3.3. is corrupt. In my instance it couldn't find the correct SSL certs.

Now that that is fixed, I have a new follow-up problem: SMTP authentication always fails.

I have 2 G-apps accounts, I tried both. On one I am a regular user, and figured I needed to be an admin of sorts to fix this. So I tried another google apps acount. The latter has 2-factor auth, but I used an app-password to get around that. Both result is:

Unfortunately no connection was possible. Review the errors below and rectify:
AuthenticationFailedException: 535 Incorrect authentication data

However, I tripple checked the data and logged in with that same data in my gmail env.

The SMTP log shows that the details aren't correct either, which makes me wonder what's going on...

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true
220-vps.xxx.com ESMTP Exim 4.82 #2 Mon, 18 Aug 2014 15:10:43 +0200 
220-We do not authorize the use of this system to transport unsolicited, 
220 and/or bulk e-mail.
DEBUG SMTP: connected to host "smtp.gmail.com", port: 465

EHLO vps.xx.com
250-vps.xx.com Hello vps.xx.com [###.###.###.###]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH PLAIN LOGIN
250 HELP
DEBUG SMTP: Found extension "SIZE", arg "52428800"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "AUTH", arg "PLAIN LOGIN"
DEBUG SMTP: Found extension "HELP", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM 
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN failed

should I delete the mail settings (is there a specific file for this?) and start over to remove any cache?

---------- EDIT ---------------------

I installed v6.2.7 on the vps to see if there's something wrong with either my install or the 6.3.3. package in general. But no help here. 6.2.7 is now giving me the SSL issues I had earlier (see: https://answers.atlassian.com/questions/325709/error-setting-up-gmail-in-jira-633-suncertpathbuilderexception/325806)

------- EDIT 21/8 ---------------

I noticed that we have a local exim running (apparently comes with cpanel). That does work. Perhaps the local exim interferes with the connection/authenticatrion protocol?

The problem is solved, albeit in a work-around manner.

5 answers

1 accepted

0 votes
Answer accepted
Thijs Baars August 24, 2014

From my edit

I noticed that we have a local exim running (apparently comes with cpanel). Using that does work. Perhaps the local exim interferes with the connection/authentication protocol?

The problem is solved, albeit in a work-around manner.

0 votes
Waheed Ur Rehman SO: Ab Rehman August 29, 2017
  • I was having the follwing error message, after setting everything right
DEBUG SMTP: Found extension "SIZE", arg "35882577"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN failed
  • in the security, I just turned the 
  • Allow less secure apps: ON

as it was off.... This removed my problem, Hope It will save somebodies day..... Best of luck

 
selmihedia March 22, 2022

thank you

0 votes
Alexey_Rjeutski__Polontech_
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 18, 2014

1. Are you sure you are trying with google mail account?

2. if yes - strictly follow instructions (with movement of jar if needed) https://confluence.atlassian.com/display/JIRA/Using+Gmail+as+a+JIRA+Mail+Server

Thijs Baars August 18, 2014

That page mentions: This article applies to JIRA versions 4.3 and below. For all other versions, please refer to Configuring JIRA's SMTP Mail Server to Send Notifications

Doesn't seem to apply since I'm using 6.3. I did follow the instructions from the linked 6.3 instructions.

0 votes
Thijs Baars August 17, 2014

Not really.

I'm using Jira 6.3.3.

The acount I actually want to use (where I am just a user) doesn't even use two-step auth.

I do note that your SMTP log is a lot longer (more extensions). Maybe there's something there?

Are there some stupid simple pre-reqs that aren't running on my vps? I inherited it and have no clue if simple stuff as build-essentials is installed.

Thijs

0 votes
Tiago Comasseto
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 17, 2014

That's interesting Thijs, I've just tested here with may gmail accound and 2-step verification enbled and the STMP worked without any problem. I've generated an app password as suggested here and this is the result:

Your test message has been sent successfully to someuser@gmail.com.

DEBUG: getProvider() returning javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Sun Microsystems, Inc]
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host "smtp.gmail.com", port 465, isSSL true
220 mx.google.com ESMTP k8sm49534869vdh.17 - gsmtp
DEBUG SMTP: connected to host "smtp.gmail.com", port: 465

EHLO ironman
250-mx.google.com at your service, [xxx.xxx.xxx.xxx]
250-SIZE 35882577
250-8BITMIME
250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
DEBUG SMTP: Found extension "SIZE", arg "35882577"
DEBUG SMTP: Found extension "8BITMIME", arg ""
DEBUG SMTP: Found extension "AUTH", arg "LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN"
DEBUG SMTP: Found extension "ENHANCEDSTATUSCODES", arg ""
DEBUG SMTP: Found extension "PIPELINING", arg ""
DEBUG SMTP: Found extension "CHUNKING", arg ""
DEBUG SMTP: Found extension "SMTPUTF8", arg ""
DEBUG SMTP: Attempt to authenticate
DEBUG SMTP: check mechanisms: LOGIN PLAIN DIGEST-MD5 NTLM 
DEBUG SMTP: AUTH LOGIN command trace suppressed
DEBUG SMTP: AUTH LOGIN succeeded

I've tested it using JIRA version 6.2.5 and the standard SMTP setting here. Are you doing anything diffent than this?

Cheers

Suggest an answer

Log in or Sign up to answer