DSpace: Java mail doesn't work in the company's network

784 views Asked by At

I set up Dspace to send e-mail using my company's e-mail server, DSpace uses javax.mail to do this.

When I try send outside of my company's network the e-mail is sent successfully, but in the company's network the email is not sent.

Follows the shown error message:

Error: javax.mail.MessagingException: Exception reading response;
nested exception is: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

(1) There's no proxy on the way
(2) I tryed to send using gmail, but I've got same scenario
(3) The only related thread that I've found were solved with proxy settings, but because (1) that is not a solution (Java mail doesn't work in the company's network)
(4) The used door (587) is the same configured in Thunderbird which works great both inside and outside my company's network.

WHAT A MISTERY!!! O.O

If some one could help, that would be great!

Thanks a lot!

1

There are 1 answers

2
Lino On

I found an answer in another thread that guided me:

Javamail non ssl properties are:

Properties props = new Properties();
props.put("mail.smtp.user", "[email protected]");
props.put("mail.smtp.password", "password");
props.put("mail.smtp.protocol", "smtp");
props.put("mail.smtp.host", "smtp.mydomain.com");
props.put("mail.smtp.port", "25");
props.put("mail.smtp.starttls.enable","false");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.socketFactory.port", "25");
props.put("mail.smtp.socketFactory.class", "");
props.put("mail.smtp.socketFactory.fallback", "false");

The only property that I changed to DSpace start send email was mail.smtp.socketFactory.class="", before was "javax.net.ssl.SSLSocketFactory".

Unfortunately I still not understand why previous settings were working outside company's network, maybe some rule blocking ssl connections.

@SergeBallesta: Thanks for the help!