#1 2022-06-29 21:05:24

moslaj
Member
Registered: 2022-06-27

Sending over SMTP not working

Hi,

i get the error below trying to send reports over smtp:

22:43:49.177 WARN  n.d.r.c.service.mail.MailServiceImpl - Mail could not be send
net.datenwerke.rs.core.service.mail.exceptions.MailerRuntimeException: Mail could not be send
    at net.datenwerke.rs.core.service.mail.MailServiceImpl$MailSupervisorImpl.handleException(MailServiceImpl.java:76) ~[reportserver.jar:na]
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:340) ~[reportserver.jar:na]
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.lambda$1(MailServiceImpl.java:393) ~[reportserver.jar:na]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_302]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_302]
    at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_302]
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.office365.com, port: 587
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2211) ~[javax.mail-1.6.2.jar:1.6.2]
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:740) ~[javax.mail-1.6.2.jar:1.6.2]
    at javax.mail.Service.connect(Service.java:388) ~[javax.mail-1.6.2.jar:1.6.2]
    at javax.mail.Service.connect(Service.java:246) ~[javax.mail-1.6.2.jar:1.6.2]
    at javax.mail.Service.connect(Service.java:195) ~[javax.mail-1.6.2.jar:1.6.2]
    at javax.mail.Transport.send0(Transport.java:254) ~[javax.mail-1.6.2.jar:1.6.2]
    at javax.mail.Transport.send(Transport.java:124) ~[javax.mail-1.6.2.jar:1.6.2]
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:330) ~[reportserver.jar:na]
    ... 4 common frames omitted
Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message
    at sun.security.ssl.SSLSocketInputRecord.handleUnknownRecord(SSLSocketInputRecord.java:455) ~[na:1.8.0_302]
    at sun.security.ssl.SSLSocketInputRecord.decode(SSLSocketInputRecord.java:184) ~[na:1.8.0_302]
    at sun.security.ssl.SSLTransport.decode(SSLTransport.java:109) ~[na:1.8.0_302]
    at sun.security.ssl.SSLSocketImpl.decode(SSLSocketImpl.java:1392) ~[na:1.8.0_302]
    at sun.security.ssl.SSLSocketImpl.readHandshakeRecord(SSLSocketImpl.java:1300) ~[na:1.8.0_302]
    at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:435) ~[na:1.8.0_302]
    at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:626) ~[javax.mail-1.6.2.jar:1.6.2]
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:400) ~[javax.mail-1.6.2.jar:1.6.2]
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:238) ~[javax.mail-1.6.2.jar:1.6.2]
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2175) ~[javax.mail-1.6.2.jar:1.6.2]
    ... 11 common frames omitted


My mail.cf:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <smtp>
      <host>smtp.office365.com</host>
      <port>587</port>
      <ssl>true</ssl>
      <tls>
         <enable>true</enable>
         <require>true</require>
      </tls>
      <username>someusername</username>
      <password>somepass</password>
   </smtp>
   <mail>
      <sender>reporting@company.com</sender>
      <senderName>ReportServer</senderName>
      <forceSender>false</forceSender>
      <encryptionPolicy>allow_mixed</encryptionPolicy>
   </mail>
</configuration>

I did the config reload in terminal.
RS version: RS3.7.0-6044
I also tried to wrap the password into CDATA.
I can't find any solution on the internet.

Thanks for the help.

BR,

Marko

Offline

#2 2022-06-30 09:12:59

eduardo
Administrator
Registered: 2016-11-01
Website

Re: Sending over SMTP not working

Hi Marko,

The error message is:
Caused by: javax.net.ssl.SSLException: Unsupported or unrecognized SSL message

you both enabled SSL and TLS? pls try to set SSL to false, and leave TLS to true. This all depends on your server settings (smtp.office365.com)

Regards,
Eduardo

Offline

#3 2022-06-30 10:01:05

moslaj
Member
Registered: 2022-06-27

Re: Sending over SMTP not working

Thank you,

SSL false helped.

BR,

Marko

Offline

Board footer

Powered by FluxBB