#1 2016-05-23 08:01:24

hvupadhye
Member
From: Mumbai, India
Registered: 2016-05-13
Posts: 24

Schedule functionality is not working

Hello Friends,

I have configured the mail.cf as below

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <smtp>
      <host>smtp.gmail.com</host>
      <port>25</port>
      <username>hvupadhye@gmail.com</username>
      <password>*******</password>
     
      <ssl>true</ssl>
      <tls>
         <enable>false</enable>
         <require>false</require>
      </tls>
   </smtp>
   <mail>
      <sender>rs@datenwerke.net</sender>
      <forceSender>false</forceSender>
      <encryptionPolicy>allow_mixed</encryptionPolicy>
   </mail>
</configuration>

but on schedule execution I am getting following error

java.lang.RuntimeException: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;
  nested exception is:
    java.net.ConnectException: Connection refused: connect
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction$1.handleException(MailReportAction.java:134)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:244)
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction.doExecute(MailReportAction.java:125)
    at net.datenwerke.scheduler.service.scheduler.entities.AbstractAction.execute(AbstractAction.java:59)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeAction(SchedulerTask.java:495)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeActions(SchedulerTask.java:385)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.safeCall(SchedulerTask.java:209)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:101)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 25;
  nested exception is:
    java.net.ConnectException: Connection refused: connect
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:642)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:234)
    ... 11 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
    at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
    at java.net.PlainSocketImpl.connect(Unknown Source)
    at java.net.SocksSocketImpl.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at java.net.Socket.connect(Unknown Source)
    at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:319)
    at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:233)
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1938)
    ... 18 more

Please help. Thanks in advance.

Offline

#2 2016-05-23 08:10:13

Arno Mittelbach
datenwerke
Registered: 2012-02-14
Posts: 690

Re: Schedule functionality is not working

As the error message says: ReportServer cannot connect to gmail with the supplied configuration. There is some information on the connection settings of gmail on https://support.google.com/a/answer/176600?hl=en. Port 25 with ssl also looks a bit odd.

My guess is, that you would need something along these lines:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <smtp>
      <host>smtp.gmail.com</host>
      <port>587</port>
      <username>hvupadhye@gmail.com</username>
      <password>*******</password>
      
      <ssl>false</ssl>
      <tls>
         <enable>true</enable>
         <require>true</require>
      </tls>
   </smtp>
   <mail>
      <sender>rs@datenwerke.net</sender>
      <forceSender>false</forceSender>
      <encryptionPolicy>allow_mixed</encryptionPolicy>
   </mail>
</configuration>

Also, you should change the <sender> address.

Hope this helps,
Arno

Offline

#3 2016-05-23 09:37:07

hvupadhye
Member
From: Mumbai, India
Registered: 2016-05-13
Posts: 24

Re: Schedule functionality is not working

Thank you arno for your valuable support. I am trying to send mail to my domain. Here is my mail.cf after your suggestions.

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
   <smtp>
      <host>smtp.****.com</host>
      <port>587</port>
      <username>manjeet.upadhye@****.com</username>
      <password>******</password>
     
      <ssl>false</ssl>
      <tls>
         <enable>true</enable>
         <require>true</require>
      </tls>
   </smtp>
   <mail>
      <sender>manjeet.upadhye@****.com</sender>
      <forceSender>false</forceSender>
      <encryptionPolicy>allow_mixed</encryptionPolicy>
   </mail>
</configuration>

But again I am getting error like this

java.lang.RuntimeException: javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction$1.handleException(MailReportAction.java:134)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:244)
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction.doExecute(MailReportAction.java:125)
    at net.datenwerke.scheduler.service.scheduler.entities.AbstractAction.execute(AbstractAction.java:59)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeAction(SchedulerTask.java:495)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.executeActions(SchedulerTask.java:385)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.safeCall(SchedulerTask.java:209)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:101)
    at net.datenwerke.scheduler.service.scheduler.tasks.SchedulerTask.call(SchedulerTask.java:1)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: javax.mail.MessagingException: STARTTLS is required but host does not support STARTTLS
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:664)
    at javax.mail.Service.connect(Service.java:317)
    at javax.mail.Service.connect(Service.java:176)
    at javax.mail.Service.connect(Service.java:125)
    at javax.mail.Transport.send0(Transport.java:194)
    at javax.mail.Transport.send(Transport.java:124)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:234)
    ... 11 more

Please help.

Offline

#4 2016-05-23 09:41:35

Arno Mittelbach
datenwerke
Registered: 2012-02-14
Posts: 690

Re: Schedule functionality is not working

Could you try <require>false</require>?

Offline

#5 2016-05-23 10:01:19

hvupadhye
Member
From: Mumbai, India
Registered: 2016-05-13
Posts: 24

Re: Schedule functionality is not working

Thank you very much ! It's working with <require>false</require> configuration. Once again thank you for your valuable support.

Offline

#6 2016-05-23 10:06:41

Arno Mittelbach
datenwerke
Registered: 2012-02-14
Posts: 690

Re: Schedule functionality is not working

I am happy to help. If you find the time it would be great if you could share your experience with ReportServer, for example on G2Crowd or on Gartner.

Cheers,
Arno

Offline

Board footer

Powered by FluxBB