RestComm / Restcomm-Connect

The Open Source Cloud Communications Platform
http://www.restcomm.com/
GNU Affero General Public License v3.0
244 stars 215 forks source link

NPE in sendEmail - From address is NULL #1684

Closed maria-farooq closed 7 years ago

maria-farooq commented 7 years ago

In restcomm sending Email to account is often part of notifications. During testing one of the notification i faced following NPE: it is faced when VoiceInterpreter try to send email. reason being: from address is null.

07:28:32,807 DEBUG [org.restcomm.connect.interpreter.VoiceInterpreter] (RestComm-akka.actor.default-dispatcher-36) DiskCacheResponse is DiskCacheResponse [succeeded=false, cause=File d07fd8a79cf1a850a021d8c21b5f8fc61db56e5568c1f592117c2b68144e1617.wav NotFound, message=null, object=null]
07:28:32,818 ERROR [org.restcomm.connect.email.EmailService] (RestComm-akka.actor.default-dispatcher-36) null: java.lang.NullPointerException
    at org.restcomm.connect.email.EmailService.send(EmailService.java:128) [restcomm-connect.email-8.1.0.issue-1614.46.jar:8.1.0.issue-1614.46]
    at org.restcomm.connect.email.EmailService.onReceive(EmailService.java:121) [restcomm-connect.email-8.1.0.issue-1614.46.jar:8.1.0.issue-1614.46]
    at akka.actor.UntypedActor$$anonfun$receive$1.applyOrElse(UntypedActor.scala:159) [akka-actor_2.10-2.1.2.jar:]
    at akka.actor.ActorCell.receiveMessage(ActorCell.scala:425) [akka-actor_2.10-2.1.2.jar:]
    at akka.actor.ActorCell.invoke(ActorCell.scala:386) [akka-actor_2.10-2.1.2.jar:]
    at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:230) [akka-actor_2.10-2.1.2.jar:]
    at akka.dispatch.Mailbox.run(Mailbox.scala:212) [akka-actor_2.10-2.1.2.jar:]
    at akka.dispatch.ForkJoinExecutorConfigurator$MailboxExecutionTask.exec(AbstractDispatcher.scala:506) [akka-actor_2.10-2.1.2.jar:]
    at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:262) [scala-library-2.10.1.jar:]
    at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:975) [scala-library-2.10.1.jar:]
    at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1478) [scala-library-2.10.1.jar:]
    at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:104) [scala-library-2.10.1.jar:]

07:28:33,748 INFO  [org.restcomm.connect.tts.acapela.AcapelaSpeechSynthesizer] (RestComm-akka.actor.default-dispatcher-31) AcapelaSpeechSynthesizer success!

@deruelle can you please guide what from address we should use in order to send notification email. i found in another module restcomm@restcomm.org, i will use it here as well

cc: @croufay i once heard you are engaged in working over notifications so keeping you in loop in case you have any feedback. cc: @gvagenas

deruelle commented 7 years ago

@maria-farooq ideally it should be an address configurable globally and shouldn't be something hardcoded.

maria-farooq commented 7 years ago

created https://github.com/RestComm/Restcomm-Connect/issues/1685