#1 2021-06-25 08:27:10

AChater
Member
Registered: 2021-03-23

automated mails

Hello,

I want to send the reports to my clients via automated mails. The mail.cf configuration file is as follows :


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


I'm getting the below exception  ! you can see that my host is "smtp.expandium.com" but I don't now why he goes to "vmail.expandium.com" even after the modification of it. should I restart something ?

java.lang.RuntimeException: javax.mail.MessagingException: Unknown SMTP host: vmail.expandium.com;
  nested exception is:
    java.net.UnknownHostException: vmail.expandium.com
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction$1.handleException(MailReportAction.java:133)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:243)
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction.doExecute(MailReportAction.java:124)
    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(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.mail.MessagingException: Unknown SMTP host: vmail.expandium.com;
  nested exception is:
    java.net.UnknownHostException: vmail.expandium.com
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1970)
    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:233)
    ... 11 more
Caused by: java.net.UnknownHostException: vmail.expandium.com
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    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



Thank you in advanced
Ayoub

Offline

#2 2021-06-25 14:23:24

AChater
Member
Registered: 2021-03-23

Re: automated mails

Hi,

I tried to restart the config by doing " config reload" on the terminal so now it is going to the right server but I still have the same error.

java.lang.RuntimeException: javax.mail.MessagingException: Unknown SMTP host: emearelay.ds.jdsu.net;
  nested exception is:
    java.net.UnknownHostException: emearelay.ds.jdsu.net
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction$1.handleException(MailReportAction.java:133)
    at net.datenwerke.rs.core.service.mail.MailServiceImpl.sendMailSync(MailServiceImpl.java:243)
    at net.datenwerke.rs.scheduler.service.scheduler.mail.MailReportAction.doExecute(MailReportAction.java:124)
    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(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: javax.mail.MessagingException: Unknown SMTP host: emearelay.ds.jdsu.net;
  nested exception is:
    java.net.UnknownHostException: emearelay.ds.jdsu.net
    at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1970)
    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:233)
    ... 11 more
Caused by: java.net.UnknownHostException: emearelay.ds.jdsu.net
    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    at java.net.Socket.connect(Socket.java:589)
    at java.net.Socket.connect(Socket.java:538)
    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


Regards;

Offline

#3 2021-06-29 08:37:37

eduardo
Administrator
Registered: 2016-11-01
Website

Re: automated mails

Hi AChater,

previously, you said the correct server was smtp.expandium.com. In the second message you use emearelay.ds.jdsu.net

which one is correct?

yes, you have to reload configuration using "config reload".

if you use 3.7.0 you can also use email datasinks. Note that email.cf is deprecated here.

Anyway, the errors mean that the IP or host in this case is not correct:
java.net.UnknownHostException

Pls. double check this.

https://docs.oracle.com/javase/8/docs/a … ption.html

Regards,
Eduardo

Offline

Board footer

Powered by FluxBB