SMTP notification problem with Gmail

Hi trying to use Notify with smtp

I get

22.219 luup_log:168: Reactor: Notify action failed: [string “–[[…”]:2211: attempt to index upvalue ‘sock’ (a nil value) (“grpnccvlmr.true” group 1 action 1) <0x7581c520>

All variables set in master reactor

This means the SSL handshake failed with the server. Make sure you are connecting to the server on a port with full time SSL (usually 465, not 587).

I am travelling for the next two weeks, so replies will be sporadic.

No rush.

SMTPServer: smtp.gmail.com
SMTPSender: myusername@gmail.com
SMTPUsername: myusername@gmail.com
SMTPPassword: myApplicationPassword16digits
SMTPPort: 465
imap is enabled

Log Error
Reactor: Notify action failed: [string “–[[…”]:2211: attempt to index upvalue ‘sock’ (a nil value) (“grpnccvlmr.true” group 1 action 1) <0x7581c520>

Try setting SSLProtocol to tlsv1_2

I am confused, so thought it best to clarify
When you say set SSLProtocol to tlsv1_2

do you mean a variable in master reactor, as there is not one . So should i set one?
I have googled tlsv1_2 regarding vera or gmail and i see no options to set SSLProtocol

Cheers

If the variable is not there, go to Advanced > New Service on the Reactor master device, create it using the following:

New service : urn:toggledbits-com:serviceId:Reactor

New variable: SSLProtocol

New value: tlsv1_2

Add the variable, then reload Luup. I recommend copy/paste for the above.

Thank you for the clarification.

variable now set, but still the same error.

That’s as far as I can take it while traveling. Back in about two weeks, I’m afraid.

Ok, no rush, i will keep investigating. i will post back in a couple of weeks if issue persists.

Thanks you.

LuaSec version may be at play here. I’m checking with the devs. Can you post just the head of your Logic Summary, the part before it starts listing conditions? Also before you do that, make sure you’re on the latest stable version.

Reactor was installed about 10 days ago from github stable branch. version":19305,“timestamp”:1580121166

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.5develop-20016 config 20017 cdata 19305 ui 19349 pluginDevice 148 LuaXP 1.0.1
    System: Vera version 1.7.4453 (pre-7.30) on Sercomm G450 ID nil (unknown); loadtime 1580228803; systemReady 1580228817; Lua 5.1; JSON dkjson 1.2; UnsafeLua=1
Local time: 2020-01-28T17:44:53+0000; DST=0; Eastbourne, England United Kingdom; formats %d/%m/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": 1580195114, "nautdawn": 1580192717, "sunset": 1580229704, "nautdusk": 1580234271, "stamp": 2020028, "latitude": 50.7687, "astrodusk": 1580236590, "longitude": 0.28453, "civdusk": 1580231874, "astrodawn": 1580190398, "sunrise": 1580197284 }
  Geofence: not running
************************************************************************************************************************************

The latest is 20020, so can I trouble you to upgrade to that and post again?

Of course

=====

*************************************************** REACTOR LOGIC SUMMARY REPORT ***************************************************
   Version: 3.5develop-20020 config 20017 cdata 19305 ui 19349 pluginDevice 148 LuaXP not loaded
    System: Vera version 1.7.4453 (pre-7.30) on Sercomm G450 ID nil (unknown); loadtime 1580234821; systemReady 1580234835; Lua 5.1; JSON dkjson 1.2; UnsafeLua=1
Local time: 2020-01-28T18:09:01+0000; DST=0; Eastbourne, England United Kingdom; formats %d/%m/%Y %H:%M:%S
House mode: plugin 1; system 1; tracking on
  Sun data: { "source": "int", "civdawn": 1580195114, "nautdawn": 1580192717, "sunset": 1580229704, "nautdusk": 1580234271, "stamp": 2020028, "latitude": 50.7687, "astrodusk": 1580236590, "longitude": 0.28453, "civdusk": 1580231874, "astrodawn": 1580190398, "sunrise": 1580197284 }
  Geofence: not running
***************************************************

Ok. It may be that because you are on 4453 7 29 firmware, the old version of LuaSec cannot meet Google’s new encryption requirements. My dev Plus running 7.31 has a newer LuaSec (0.8), but I don’t recall if I upgraded it manually or it was part of the distribution. Vera devs will confirm. Sit tight until I get that answer. It may be that 7.30 or 7 31 is required for you to connect to Gmail, but I don’t want you to do that upgrade unless that’s confirmed.

@ElCid please try setting SMTPSSLVerify to none. You may need to create this variable as you did in the prior post here.

Same error, debug set to 1

luup_log:148: Reactor: Notify action failed: [string "--[[..."]:2211: attempt to index upvalue 'sock' (a nil value) ("root.true" group 1 action 1) <0x76698520>

OK. Please follow the instructions in the Troubleshooting section of the Tools tab to produce a log snippet. These instructions need to be followed very carefully and with correct timing, so please read them through first so that you understand what it is you need to do and when. Then send the log to me per the instructions.

log and logic sent.

OK, I’m sorry, I gave you the wrong variable name earlier–forgot to include the facilty prefix–it should be SMTPSSLProtocol. Please set that variable to tlsv1 and try again.

EDIT: Works! Summary of fix:

For the record, my testing on 7.30 and up on a Vera Plus shows a more modern LuaSec (0.8 vs 0.5 previously) in the base firmware, so it should not be necessary to set these values.

As we understand it today, to use SMTP notification with Gmail in Reactor, all users of firmware 7.29 and below, and all users of Vera Edge 7.31 and below, must set the following state variable:

SMTPSSLProcotol = tlsv1

Users that apply this variable change and later upgrade to 7.30 or higher should return the variable to default any upon upgrading to 7.30 or higher, as with time additional TLS levels may be implemented and you may need access to them as servers upgrade their security.

No Problen

All working now

Thank you rigpapa,