• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Strange SMTP errors

    User help
    2
    10
    3.8k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • danD
      dan
      last edited by

      Hey Guys, I've had a production system in place for a few years now with no issues. Lately the system hasn't been sending email reports / notifications etc.

      I've checked the log and found the following...

      WARN  2018-04-09 11:45:43,852 (com.serotonin.m2m2.rt.maint.work.EmailWorkItem.execute:86) - Error sending email
      org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: in-v3.mailjet.com, port: 465, response: -1. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: in-v3.mailjet.com, port: 465, response: -1; message exception details (1) are:
      Failed message 1:
      javax.mail.MessagingException: Could not connect to SMTP host: in-v3.mailjet.com, port: 465, response: -1
      
      

      I've tried the other ports such as 25, 587 TLS on/off etc, and all the same errors.
      I can ping the hosts, I've also tried just IP Address.
      Maybe something is not working with the way Java connects to these hosts?

      Cheers
      Dan

      Jared WiltshireJ 1 Reply Last reply Reply Quote 0
      • Jared WiltshireJ
        Jared Wiltshire @dan
        last edited by Jared Wiltshire

        @dan Definitely just looks like it can't connect, pinging just means the host is up, it doesn't indicate that port 465 is open. Check your SMTP provider hasn't changed their hostname, ports, configuration options etc.

        Developer at Radix IoT

        1 Reply Last reply Reply Quote 0
        • danD
          dan
          last edited by

          I've tried multiple SMTP providers.
          Is the SMTP client using a Java library or something you guys wrote?

          Jared WiltshireJ 1 Reply Last reply Reply Quote 0
          • danD
            dan
            last edited by

            the other thing I wondered was, is there a timeout for connection? This connection is now on a satellite link, so latency is <> 800ms

            root@water:~# ping in-v3.mailjet.com
            PING in.mailjet.com (104.199.96.85) 56(84) bytes of data.
            64 bytes from 85.96.199.104.bc.googleusercontent.com (104.199.96.85): icmp_seq=1 ttl=41 time=900 ms
            64 bytes from 85.96.199.104.bc.googleusercontent.com (104.199.96.85): icmp_seq=2 ttl=41 time=871 ms
            64 bytes from 85.96.199.104.bc.googleusercontent.com (104.199.96.85): icmp_seq=3 ttl=41 time=862 ms
            ^C
            --- in.mailjet.com ping statistics ---
            4 packets transmitted, 3 received, 25% packet loss, time 2998ms
            rtt min/avg/max/mdev = 862.077/878.014/900.703/16.511 ms
            root@water:~# telnet in-v3.mailjet.com 465
            Trying 104.199.96.85...
            Connected to in.mailjet.com.
            Escape character is '^]'.
            

            it appears to connect from shell.

            1 Reply Last reply Reply Quote 0
            • danD
              dan
              last edited by

              one more thing, the SMTP server mailjet uses quite a long password (hash)
              Do you know if there is a limit on length of password in the java client?

              1 Reply Last reply Reply Quote 0
              • Jared WiltshireJ
                Jared Wiltshire @dan
                last edited by Jared Wiltshire

                @dan said in Strange SMTP errors:

                I've tried multiple SMTP providers.
                Is the SMTP client using a Java library or something you guys wrote?

                We use the Spring class org.springframework.mail.javamail.JavaMailSenderImpl to send the emails, it is a simple wrapper around the Java javax.mail.* interfaces.

                @dan said in Strange SMTP errors:

                the other thing I wondered was, is there a timeout for connection?

                We do not set a timeout, it would be the default (according to https://javaee.github.io/javamail/docs/api/com/sun/mail/smtp/package-summary.html that means its infinite).

                @dan said in Strange SMTP errors:

                it appears to connect from shell.

                On the same machine that Mango is running on? Have you checked the firewalls etc?

                @dan said in Strange SMTP errors:

                Do you know if there is a limit on length of password in the java client?

                There is no limit.

                Are you using TLS? Maybe its now required or something? What JRE are you using?

                Developer at Radix IoT

                1 Reply Last reply Reply Quote 0
                • danD
                  dan
                  last edited by

                  This is running on one of those MangoES solid state bad boys. It's been super reliable.

                  root@water:~# java -version
                  java version "1.8.0-ea"
                  Java(TM) SE Runtime Environment (build 1.8.0-ea-b111)
                  Java HotSpot(TM) Client VM (build 25.0-b53, mixed mode)
                  
                  
                  1 Reply Last reply Reply Quote 0
                  • danD
                    dan
                    last edited by

                    I've even tried using localhost as the mail server and tailed the log...

                    Apr 11 09:36:04 water postfix/smtpd[9329]: connect from localhost[127.0.0.1]
                    Apr 11 09:36:11 water postfix/smtpd[9329]: lost connection after HELO from localhost[127.0.0.1]
                    Apr 11 09:36:11 water postfix/smtpd[9329]: disconnect from localhost[127.0.0.1]
                    

                    It appears that the HELO part is failing. This seems to be related to the hostname, I haven't changed this that I'm aware of however :-/

                    WARN  2018-04-11 09:36:04,555 (com.serotonin.m2m2.rt.maint.work.EmailWorkItem.execute:86) - Error sending email
                    org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: 501 Syntax: HELO hostname
                    . Failed messages: javax.mail.MessagingException: 501 Syntax: HELO hostname
                    ; message exception details (1) are:
                    Failed message 1:
                    javax.mail.MessagingException: 501 Syntax: HELO hostname
                    
                    
                    1 Reply Last reply Reply Quote 0
                    • danD
                      dan
                      last edited by

                      OK, I think I've resolved it, managed to remove all the settings, add them all in again using port 587, TLS with mailjet and it's working.

                      Thanks for your assistance :)

                      Cheers
                      Dan

                      Jared WiltshireJ 1 Reply Last reply Reply Quote 0
                      • Jared WiltshireJ
                        Jared Wiltshire @dan
                        last edited by

                        @dan said in Strange SMTP errors:

                        OK, I think I've resolved it, managed to remove all the settings, add them all in again using port 587, TLS with mailjet and it's working.

                        Thanks for your assistance :)

                        Cheers
                        Dan

                        Great, glad you got it working.

                        Developer at Radix IoT

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post