Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

David I
Ehlo,

We're running a 3.6.0 instance of Geonetwork in a Jetty 9.2 servlet in the
dmz region of a network and are trying to use the company's MS Exchange
server (2016 or so) for the Feedback mail setting in Geonetwork.

We've been adviced to use port 25, no tls or ssl, no username or password
just the email address and email smtp server. The local IT department have
adviced that they have successfully sent email using MS Powershell from this
server with these settings.

In GN we get this error message when using the Test email settings button:
 535 5.7.3 Authentication unsuccessful (server, port)

Logs say:

DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: getProvider() returning
javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: need username and password for authentication
DEBUG SMTP: useEhlo true, useAuth true

then it says ehlo and connects
and then

DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN DIGEST-MD5
NTLM
DEBUG SMTP: mechanism LOGIN not supported by server
DEBUG SMTP: mechanism PLAIN not supported by server
DEBUG SMTP: mechanism DIGEST-MD5 not supported by server
DEBUG NTLM: type 1 message: 4E 54 ..
DEBUG SMTP: AUTH NTLM command trace suppressed
DEBUG SMTP: AUTH NTLM failed
2019-05-09 10:45:28,377 ERROR [geonetwork.api] - Error sending test email
org.apache.commons.mail.EmailException: Sending the email to the following
server failed (smtp server and port) ...


Caused by: javax.mail.AuthenticationFailedException: 535 5.7.3
Authentication unsuccessful

Does anyone have any suggestions? : )

(It says the same thing if we input username and pass in the settings)




--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

Juan Luis Rodríguez Ponce
On Thu, May 9, 2019 at 1:17 PM David I <[hidden email]> wrote:

> Ehlo,
>
> We're running a 3.6.0 instance of Geonetwork in a Jetty 9.2 servlet in the
> dmz region of a network and are trying to use the company's MS Exchange
> server (2016 or so) for the Feedback mail setting in Geonetwork.
>
> We've been adviced to use port 25, no tls or ssl, no username or password
> just the email address and email smtp server. The local IT department have
> adviced that they have successfully sent email using MS Powershell from
> this
> server with these settings.
>
> In GN we get this error message when using the Test email settings button:
>  535 5.7.3 Authentication unsuccessful (server, port)
>
> Logs say:
>
> DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
> DEBUG SMTP: need username and password for authentication
> DEBUG SMTP: useEhlo true, useAuth true
>
> then it says ehlo and connects
> and then
>
> DEBUG SMTP: Attempt to authenticate using mechanisms: LOGIN PLAIN
> DIGEST-MD5
> NTLM
> DEBUG SMTP: mechanism LOGIN not supported by server
> DEBUG SMTP: mechanism PLAIN not supported by server
> DEBUG SMTP: mechanism DIGEST-MD5 not supported by server
> DEBUG NTLM: type 1 message: 4E 54 ..
> DEBUG SMTP: AUTH NTLM command trace suppressed
> DEBUG SMTP: AUTH NTLM failed
> 2019-05-09 10:45:28,377 ERROR [geonetwork.api] - Error sending test email
> org.apache.commons.mail.EmailException: Sending the email to the following
> server failed (smtp server and port) ...
>
>
> Caused by: javax.mail.AuthenticationFailedException: 535 5.7.3
> Authentication unsuccessful
>
> Does anyone have any suggestions? : )
>
> (It says the same thing if we input username and pass in the settings)
>
> It shouldn't use authentication if it is not set in the settings. Please
> check if the value for Feedback -> Username setting is really empty (empty
> string, no blank spaces) and try again.
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html
>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>


--










*Vriendelijke groeten / Kind regards,Juan Luis Rodríguez.
<http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664>Please consider the environment before printing
this email.*

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

David I
> It shouldn't use authentication if it is not set in the settings. Please
> check if the value for Feedback -> Username setting is really empty (empty
> string, no blank spaces) and try again.

Hi. We made sure nothing is in those boxes as far as one can in the UI and
it doesn't matter, it still tries to authenticate.

Is there some other place where these mail settings are defined?

By default it had some issues finding some resources but these warnings
appear not to make much of a difference (we tried putting
activation-1.1.1.jar in the classpath, as well as with a 1.6 version of
SendMail, it still tries to authenticate):

DEBUG: JavaMail version 1.4.1
DEBUG: not loading file: C:\Java\jdk1.8.0_181\jre\lib\javamail.providers
DEBUG: java.io.FileNotFoundException:
C:\Java\jdk1.8.0_181\jre\lib\javamail.providers (The system cannot find the
file specified)
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.providers
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,Oracle],
com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle],
com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle],
com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle],
com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle],
com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}
DEBUG: Providers Listed By Protocol:
{imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle],
imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle],
smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle],
pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle],
pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle],
smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]}
DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
DEBUG: !anyLoaded
DEBUG: not loading resource: /META-INF/javamail.address.map
DEBUG: not loading file: C:\Java\jdk1.8.0_181\jre\lib\javamail.address.map
DEBUG: java.io.FileNotFoundException:
C:\Java\jdk1.8.0_181\jre\lib\javamail.address.map (The system cannot find
the file specified)
DEBUG: getProvider() returning
javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
DEBUG SMTP: need username and password for authentication
DEBUG SMTP: useEhlo true, useAuth true
DEBUG SMTP: trying to connect to host < > ..



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

Juan Luis Rodríguez Ponce
Maybe we need to set the property properties.put("mail.smtp.auth", "true");
in the mail session properties as else branch in the if at 1]

[1]
https://github.com/geonetwork/core-geonetwork/blob/3.6.x/core/src/main/java/org/fao/geonet/util/MailUtil.java#L359-L361

On Mon, May 13, 2019 at 1:36 PM David I <[hidden email]> wrote:

> > It shouldn't use authentication if it is not set in the settings. Please
> > check if the value for Feedback -> Username setting is really empty
> (empty
> > string, no blank spaces) and try again.
>
> Hi. We made sure nothing is in those boxes as far as one can in the UI and
> it doesn't matter, it still tries to authenticate.
>
> Is there some other place where these mail settings are defined?
>
> By default it had some issues finding some resources but these warnings
> appear not to make much of a difference (we tried putting
> activation-1.1.1.jar in the classpath, as well as with a 1.6 version of
> SendMail, it still tries to authenticate):
>
> DEBUG: JavaMail version 1.4.1
> DEBUG: not loading file: C:\Java\jdk1.8.0_181\jre\lib\javamail.providers
> DEBUG: java.io.FileNotFoundException:
> C:\Java\jdk1.8.0_181\jre\lib\javamail.providers (The system cannot find the
> file specified)
> DEBUG: !anyLoaded
> DEBUG: not loading resource: /META-INF/javamail.providers
> 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,Oracle],
>
> com.sun.mail.smtp.SMTPTransport=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle],
>
> com.sun.mail.imap.IMAPSSLStore=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle],
>
> com.sun.mail.pop3.POP3SSLStore=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle],
>
> com.sun.mail.imap.IMAPStore=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle],
>
> com.sun.mail.pop3.POP3Store=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle]}
> DEBUG: Providers Listed By Protocol:
>
> {imaps=javax.mail.Provider[STORE,imaps,com.sun.mail.imap.IMAPSSLStore,Oracle],
> imap=javax.mail.Provider[STORE,imap,com.sun.mail.imap.IMAPStore,Oracle],
>
> smtps=javax.mail.Provider[TRANSPORT,smtps,com.sun.mail.smtp.SMTPSSLTransport,Oracle],
> pop3=javax.mail.Provider[STORE,pop3,com.sun.mail.pop3.POP3Store,Oracle],
>
> pop3s=javax.mail.Provider[STORE,pop3s,com.sun.mail.pop3.POP3SSLStore,Oracle],
>
> smtp=javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]}
> DEBUG: successfully loaded resource: /META-INF/javamail.default.address.map
> DEBUG: !anyLoaded
> DEBUG: not loading resource: /META-INF/javamail.address.map
> DEBUG: not loading file: C:\Java\jdk1.8.0_181\jre\lib\javamail.address.map
> DEBUG: java.io.FileNotFoundException:
> C:\Java\jdk1.8.0_181\jre\lib\javamail.address.map (The system cannot find
> the file specified)
> DEBUG: getProvider() returning
> javax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]
> DEBUG SMTP: need username and password for authentication
> DEBUG SMTP: useEhlo true, useAuth true
> DEBUG SMTP: trying to connect to host < > ..
>
>
>
> --
> Sent from:
> http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html
>
>
> _______________________________________________
> GeoNetwork-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/geonetwork-users
> GeoNetwork OpenSource is maintained at
> http://sourceforge.net/projects/geonetwork
>


--










*Vriendelijke groeten / Kind regards,Juan Luis Rodríguez.
<http://www.geocat.net/>Veenderweg 136721 WD BennekomThe NetherlandsT: +31
(0)318 416664 <+31318416664>Please consider the environment before printing
this email.*

_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
Reply | Threaded
Open this post in threaded view
|

Re: Feedback mail (javamail) GN 3.6.0 : javax.mail.AuthenticationFailedException: 535 5.7.3 Authentication unsuccessful

David I
Hi.

Yes, maybe. Was thinking that erasing everything in the username field would
send an empty string and not null but reconsidering your reply the issue
might be that that the auth property is always true and you are suggesting
to make it false by default and only true if there is in fact something in
the username field.

I don't suppose lots of users have tried email settings like these :  ) I'll
query our IT if we can indeed supply a username and pass and use
authentication but your suggested code change seems like a good idea from
the little I may understand of it.



--
Sent from: http://osgeo-org.1560.x6.nabble.com/GeoNetwork-users-f3860293.html


_______________________________________________
GeoNetwork-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/geonetwork-users
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork