This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

Email sending do not work
#21
Hello,

I have changed to mail server from gmail to the customer account and I get below error.


* arg: 1
* nil
* arg: 2
* string: wantread

What does it mean?

Thanks.
Reply
#22
wantread is an SSL-related message. What firmware version and which email provider are you using?
Reply
#23
Hi admin,
exc
firmware version is SW: 20191015. They are using microsoft exchange server for mail accounts and created an account for logic machine.

Also I have tried with gmail smtp and I get below error;

* arg: 1
* nil
* arg: 2
* string: timeout
Reply
#24
This can possibly be some firewall/router issue. Try this script and post what you get in Logs tab:
Code:
require('socket')
ssl = require('ssl')

s = socket.tcp()
s:settimeout(5)

res, err = s:connect('smtp.gmail.com', 465)
log('connect', res, err)
if res then
  res, err = ssl.wrap(s, { mode = 'client', protocol = 'tlsv12' })
  log('wrap', res, err)

  if res then
    s = res
    s:settimeout(5)
    res, err = s:dohandshake()
    log('handshake', res, err)

    if res then
      res, err = s:receive('*l')
      log('receive', res, err)
    end
  end
end
s:close()
You can also replace 'smtp.gmail.com', 465 with another host/port with SSL support to test the connection.
Reply
#25
Hi admin,

The log for gmail is:
"Event for Mail (32/1/39) 27.11.2020 22:54:47
* arg: 1
* string: connect
* arg: 2
* nil
* arg: 3
* string: timeout"

The log for local account;

"Event for Mail (32/1/39) 27.11.2020 23:01:10
* arg: 1
* string: connect
* arg: 2
* number: 1
* arg: 3
* nil
Event for Mail (32/1/39) 27.11.2020 23:01:10
* arg: 1
* string: wrap
* arg: 2
* SSL connection: 0xb6f0eda8
* arg: 3
* nil
Event for Mail (32/1/39) 27.11.2020 23:01:10
* arg: 1
* string: handshake
* arg: 2
* bool: true
* arg: 3
* nil
Event for Mail (32/1/39) 27.11.2020 23:01:15
* arg: 1
* string: receive
* arg: 2
* nil
* arg: 3
* string: wantread
Reply
#26
The first error means that LM cannot connect to gmail at all. It might be caused by router/firewall or simply incorrect/missing gateway and DNS settings in LM.
The second error means that the mail server is not sending enough data for the encryption layer to decrypt. Have you tried your local server without encryption? Set port to 25 and comment or remove "secure" line from the mail settings.
Reply
#27
(30.11.2020, 07:35)admin Wrote: The first error means that LM cannot connect to gmail at all. It might be caused by router/firewall or simply incorrect/missing gateway and DNS settings in LM.
The second error means that the mail server is not sending enough data for the encryption layer to decrypt. Have you tried your local server without encryption? Set port to 25 and comment or remove "secure" line from the mail settings.
Hi Admin,

I'm battling away with a similar problem.
I'm confident I have the correct DNS settings and Gateway settings. 
I am continually seeing wantread errors.
The IT department have naturally assured me its something in my LM(Clipsal Nac) but I am certainly confident it isn't. Usual battles with buck passing.
Is it possible for you to suggest a list of items on their end to check to ensure it is possible to connect.
Version is 1.6 but i think thats a clipsal version number?
what SSL would be best? I've tried sslv23 and tlsv1_2.

Brent
Reply
#28
Are you using my test script? Does it get to the dohandshake or receive part?
Reply
#29
(24.03.2021, 09:22)admin Wrote: Are you using my test script? Does it get to the dohandshake or receive part?

Yeah, using your test script.
See photo for results. Handshake and receive are both present.

Attached Files Image(s)
   
Reply
#30
Have you checked if there's a newer firmware available? This issue might also be caused by an old SSL library.
Reply
#31
(25.03.2021, 07:14)admin Wrote: Have you checked if there's a newer firmware available? This issue might also be caused by an old SSL library.

Unfortunately I'm bound by the rather slow release of firmware for the clipsal/schneider Shac/Nac product line.
Their firmware number is 1.6.0 but I don't know how that relates to the LM firmware number.
The last update was issued in August 2018!!!!! I'm made a few enquiries to them on this issue don't worry.

Can you explain the wantread result? 
If I was to get the facility to create a certificate for the NAC under their domain would that improve the SSL issue if it exists?
Seeing as the Gmail work around is to enable less trustworthy devices this might be where the conflict lies in the process?

Brent
Reply
#32
SSL certificate is for the server mode whereas sending email is done in client mode. Enabling less secure apps won't do anything because the script fails before the login happens. Wantread means that there's not enough data (or no data at all) to be read from the server. During normal operation at this point the SMTP server sends a greeting line to the client.
Alternative solution is to use a mail sending service that has API so you can send via HTTPS requests instead of SMTP. Try https://sendgrid.com/ or https://www.mailjet.com/
Reply


Forum Jump: