Announcement

Collapse
No announcement yet.

Error while sending email

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error while sending email

    Hi,

    I have a mirth instance configured to send emails for a particular channel.
    Email sender is the destination for this channel.

    I am using smtp.gmail.com as my smtp server.
    port is 587. It is using tls.

    I am able to telnet to smtp.gmail.com on port 587 from the machine. Therefore connectivity is not an issue. I am getting the following error in the mith log which I dont know what to do. Any help would be appreciated.

    FAILURE: Error sending email
    MessagingException
    Could not convert socket to TLS



    Detailed exception:-


    ERROR-402: SMTP connector error
    ERROR MESSAGE: Error sending email
    javax.mail.MessagingException: Could not convert socket to TLS;
    nested exception is:
    java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
    at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTrans port.java:1230)
    at com.sun.mail.smtp.SMTPTransport.protocolConnect(SM TPTransport.java:378)
    at javax.mail.Service.connect(Service.java:297)
    at javax.mail.Service.connect(Service.java:156)
    at javax.mail.Service.connect(Service.java:105)
    at javax.mail.Transport.send0(Transport.java:168)
    at javax.mail.Transport.send(Transport.java:98)
    at com.webreach.mirth.connectors.email.SmtpMessageDis patcher.sendMailMessage(SmtpMessageDispatcher.java :199)
    at com.webreach.mirth.connectors.email.SmtpMessageDis patcher.doDispatch(SmtpMessageDispatcher.java:156)
    at com.webreach.mirth.connectors.email.SmtpMessageDis patcher.doSend(SmtpMessageDispatcher.java:187)
    at org.mule.providers.AbstractMessageDispatcher.send( AbstractMessageDispatcher.java:167)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:191)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:130)
    at org.mule.routing.outbound.AbstractOutboundRouter.s end(AbstractOutboundRouter.java:85)
    at org.mule.routing.outbound.FilteringMulticastingRou ter.route(FilteringMulticastingRouter.java:45)
    at org.mule.routing.outbound.OutboundMessageRouter$1. doInTransaction(OutboundMessageRouter.java:78)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:48)
    at org.mule.routing.outbound.OutboundMessageRouter.ro ute(OutboundMessageRouter.java:82)
    at org.mule.impl.model.DefaultMuleProxy.onCall(Defaul tMuleProxy.java:247)
    at org.mule.impl.model.seda.SedaComponent.doSend(Seda Component.java:209)
    at org.mule.impl.model.AbstractComponent.sendEvent(Ab stractComponent.java:277)
    at org.mule.impl.MuleSession.sendEvent(MuleSession.ja va:201)
    at org.mule.routing.inbound.InboundMessageRouter.send (InboundMessageRouter.java:180)
    at org.mule.routing.inbound.InboundMessageRouter.rout e(InboundMessageRouter.java:147)
    at org.mule.providers.AbstractMessageReceiver$Default InternalMessageListener.onMessage(AbstractMessageR eceiver.java:493)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:272)
    at org.mule.providers.AbstractMessageReceiver.routeMe ssage(AbstractMessageReceiver.java:235)
    at com.webreach.mirth.connectors.jdbc.JdbcMessageRece iver.processMessage(JdbcMessageReceiver.java:168)
    at org.mule.providers.TransactedPollingMessageReceive r$1.doInTransaction(TransactedPollingMessageReceiv er.java:98)
    at org.mule.transaction.TransactionTemplate.execute(T ransactionTemplate.java:72)
    at org.mule.providers.TransactedPollingMessageReceive r.poll(TransactedPollingMessageReceiver.java:104)
    at org.mule.providers.PollingMessageReceiver.run(Poll ingMessageReceiver.java:90)
    at org.mule.impl.work.WorkerContext.run(WorkerContext .java:290)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.runTask(ThreadPoolExecutor. java:650)
    at edu.emory.mathcs.backport.java.util.concurrent.Thr eadPoolExecutor$Worker.run(ThreadPoolExecutor.java :675)
    at java.lang.Thread.run(Thread.java:619)
    Caused by: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
    at javax.net.ssl.DefaultSSLSocketFactory.throwExcepti on(SSLSocketFactory.java:179)
    at javax.net.ssl.DefaultSSLSocketFactory.createSocket (SSLSocketFactory.java:199)
    at com.sun.mail.util.SocketFetcher.startTLS(SocketFet cher.java:249)
    at com.sun.mail.smtp.SMTPTransport.startTLS(SMTPTrans port.java:1226)
    ... 35 more
    Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
    at java.security.Provider$Service.newInstance(Provide r.java:1245)
    at sun.security.jca.GetInstance.getInstance(GetInstan ce.java:220)
    at sun.security.jca.GetInstance.getInstance(GetInstan ce.java:147)
    at javax.net.ssl.SSLContext.getInstance(SSLContext.ja va:125)
    at javax.net.ssl.SSLContext.getDefault(SSLContext.jav a:68)
    at javax.net.ssl.SSLSocketFactory.getDefault(SSLSocke tFactory.java:102)
    at com.sun.mail.util.SocketFetcher.startTLS(SocketFet cher.java:247)
    ... 36 more
    Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: /opt/Mirth/conf (Is a directory)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl .getDefaultKeyManager(DefaultSSLContextImpl.java:1 20)
    at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl .<init>(DefaultSSLContextImpl.java:40)
    at sun.reflect.GeneratedConstructorAccessor96.newInst ance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newI nstance(DelegatingConstructorAccessorImpl.java:27)




    Regards,
    Satyam
    at java.lang.reflect.Constructor.newInstance(Construc tor.java:513)
    at java.lang.Class.newInstance0(Class.java:355)
    at java.lang.Class.newInstance(Class.java:308)
    at java.security.Provider$Service.newInstance(Provide r.java:1221)
    ... 42 more
    Caused by: java.io.FileNotFoundException: /opt/Mirth/conf (Is a directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.jav a:106)
    at java.io.FileInputStream.<init>(FileInputStream.jav a:66)
    at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl $2.run(DefaultSSLContextImpl.java:123)
    at com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl $2.run(DefaultSSLContextImpl.java:121)
    ... 51 more

  • #2
    Gmail can be really tricky

    I would suggest you research on the gmail side and not the Mirth side. Mirth works great and my history with gmail is that it can be really finicky in attaching to it from any type of client. Review their recommendations and make sure every i is dotted and every t is crossed. Then see if you're still getting errors. Gmail works great but you are bumping up against one of the trickier parts of using it.

    Also, the Mirth Appliance doesn't have to use Gmail. It can send mail on it's own. (Not sure if you have the appliance or not)
    Jimmy
    - Denver, Colorado

    Comment


    • #3
      Configure Gmail to use client

      You also need to configure gmail to allow pop access for that account if you haven't done it yet.

      Here are their recommended settings:

      Incoming Mail (POP3) Server - requires SSL: pop.gmail.com
      Use SSL: Yes
      Port: 995
      Outgoing Mail (SMTP) Server - requires TLS or SSL: smtp.gmail.com (use authentication)
      Use Authentication: Yes
      Port for TLS/STARTTLS: 587
      Port for SSL: 465
      Account Name: your full email address (including @gmail.com or @your_domain.com)
      Email Address: your email address ([email protected] or [email protected]_domain.com)
      Password: your Gmail password
      Jimmy
      - Denver, Colorado

      Comment


      • #4
        @metropath
        Hi,

        I have checked the settings. I think the exception is not about these google settings. It is something else.

        Comment


        • #5
          Mirth TLS implementation problem with Gmail.

          Originally posted by satyam View Post
          @metropath
          Hi,

          I have checked the settings. I think the exception is not about these google settings. It is something else.
          It's starting to look like a Mirth implementation problem. Hopefully someone from Mirth can offer some support. Do you have an appliance? Mirth has its own built in email service, too. Just not sure it's on the distribution or only available on appliances.

          I think if you were using a less secure mail server, you probably wouldn't be having these issues, but it appears the implementation of TLS in Mirth is not working with Gmail. Have you tried using the different ports available with Gmail? They have multiple ports that you can try. I have found that just changing to one of their alternative ports has resolved problems when I'm connecting a client to them.

          I think you need to focus on these errors: (Sorry I don't have more input for you)

          Detailed exception:-


          ERROR-402: SMTP connector error
          ERROR MESSAGE: Error sending email
          javax.mail.MessagingException: Could not convert socket to TLS;
          nested exception is:
          java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
          Caused by: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
          Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl )
          Caused by: java.security.PrivilegedActionException: java.io.FileNotFoundException: /opt/Mirth/conf (Is a directory)
          Caused by: java.io.FileNotFoundException: /opt/Mirth/conf (Is a directory)
          Jimmy
          - Denver, Colorado

          Comment


          • #6
            I had a similar problem running Mirth on Windows to a Linux SMTP server that allowed my workstation to relay emails for internal notifications. Wouldn't work, don't remember if it was the same error or not.

            So, what I did was set up the Windows SMTP service, point Mirth to it on my local workstation and point the Windows SMTP to the Linux email server. That worked, but would've been nicer to go the direct route.

            -cp

            Comment

            Working...
            X