SMTPS Working

It is possible to do SMTPS with username and password authentication (works with gmail). I posted my code on github, but I am not permitted to put a direct link there. So you can enter this in your browser yourself if you want to see the original code: github . com / slushpupie / lua-socket.smtps

Neat! Thanks for that!!

Now if you would like MCV to make changes so that a plugin that utilizes SMTPS to send your notifications to you than express your option at the following URL:

[url=http://forum.micasaverde.com/index.php/topic,9525.0.html]http://forum.micasaverde.com/index.php/topic,9525.0.html[/url]

Thanks for the code. I have been using one of my servers as a relay for interfacing with my gmail accounts.

  • Garrett

Thanks for the code! Any plans to package it as a plugin?

PS. I noticed a typo in “test.lua”, line 30 should be:
“source = smtps.message(mesgt),”
(smtps instead of smtp)

[quote=“capjay, post:5, topic:170982”]Thanks for the code! Any plans to package it as a plugin?

PS. I noticed a typo in “test.lua”, line 30 should be:
“source = smtps.message(mesgt),”
(smtps instead of smtp)[/quote]

Considering I literally got my first z-wave device (aside from the Vera) today, I might need some time to play with how all the XML/json/Lua works together to package it up, but yeah, I think that is a goal.

Awesome man! Looking forward to it!

Sent from my ADR6425LVW using Tapatalk

If anyone is interested in following along, the code will be here: GitHub - slushpupie/upnp-smtps-alert: SMTPS Alerts

What is there works, but is non-obvious to users of what to do with it or how to install. Ill be cleaning that up soon.

Hey slushpupie,

I tried to install your plugin and followed your directions, but I’m seeing the following error in my logs:

01 03/24/12 23:41:37.493 Device_LuaUPnP::LoadDeviceDoc ixmlParseBufferEx /etc/cmh-ludl//D_SmtpsAlert.xml size 31959 ret 12 <0x400>
01 03/24/12 23:41:37.494 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 60/D_SmtpsAlert.xml so device 60 is offline <0x400>
01 03/24/12 23:41:38.083 Device_LuaUPnP::CreateServices Aborting device 60 because the topmost device has no interface <0x400>
01 03/24/12 23:41:38.084 JobHandler_LuaUPnP::CreateAllServices failed to create 60 <0x400>
01 03/24/12 23:41:38.138 UPnPAction_Send::ParseState can’t find name <0x400>

[quote=“kyle4269, post:9, topic:170982”]Hey slushpupie,

I tried to install your plugin and followed your directions, but I’m seeing the following error in my logs:

01 03/24/12 23:41:37.493 Device_LuaUPnP::LoadDeviceDoc ixmlParseBufferEx /etc/cmh-ludl//D_SmtpsAlert.xml size 31959 ret 12 <0x400>
01 03/24/12 23:41:37.494 JobHandler_LuaUPnP::CreateDevice_LuaUPnP failed to load 60/D_SmtpsAlert.xml so device 60 is offline <0x400>
01 03/24/12 23:41:38.083 Device_LuaUPnP::CreateServices Aborting device 60 because the topmost device has no interface <0x400>
01 03/24/12 23:41:38.084 JobHandler_LuaUPnP::CreateAllServices failed to create 60 <0x400>
01 03/24/12 23:41:38.138 UPnPAction_Send::ParseState can’t find name <0x400>[/quote]

Maybe I should have said “it works for me” :slight_smile:

What firmware version are you running? I depend on the fact Luup includes /etc/cmh-ludl in its module path, which I think may be a fairly recent version

Thanks for the quick response. I’m running UI4 right now.

Try this… edit the file I_SmtpsAlert.xml in your favorite text editor, find the function mystartup an add this line to the beginning of the function

package.path = package.path .. ";/etc/cmh-ludl/?.lua"

This would be line 38. Then upload the files and see how that goes for you.

[quote=“slushpupie, post:12, topic:170982”]Try this… edit the file I_SmtpsAlert.xml in your favorite text editor, find the function mystartup an add this line to the beginning of the function

package.path = package.path .. ";/etc/cmh-ludl/?.lua"

This would be line 38. Then upload the files and see how that goes for you.[/quote]

When i edited the file, I noticed that my download somehow got corrupted. I downloaded again and all seemed fine. When I tested to see if it would send me the email, I now get this error:

01 03/26/12 0:17:29.839 LuaInterface::CallFunction-1 device 60 function SSmtpsAlert_SmtpsAlert1_SendEmail_run failed [string “…”]:17: attempt to concatenate a nil value <0x2c0c>

I admittedly have not put much error checking into this plugin yet, Im pretty sure that just means you are missing one of the settings. Make sure you have configured everything described in the readme

hmmm I went over all the settings again, and cant seem to find one I missed… I set the smtp server. user,pass, and FromEmail variables…

Hi

I also get this msg.

JobHandler_LuaUPnP::HandleActionRequest device: 110 service: urn:slushpupie-com:serviceId:SmtpsAlert1 action: SendEmail <0x2f851680>
08 04/13/12 11:21:09.525 JobHandler_LuaUPnP::HandleActionRequest argument Message=Value <0x2f851680>
08 04/13/12 11:21:09.525 JobHandler_LuaUPnP::HandleActionRequest argument Recipient=dahl@cokeman.dk <0x2f851680>
01 04/13/12 11:21:09.526 LuaInterface::CallFunction_Job device 110 function SSmtpsAlert_SmtpsAlert1_SendEmail_run failed [string “…”]:17: attempt to concatenate a nil value <0x2f851680>

BTW: any chance of getting it to work via luup code, as I need to pull tha value of my powermeter and have that value sendt to an email adr.

Yeah, I think I need to better solve how the variables get set. Its obvious from the error that some piece of information (the to/from/server/username/password/etc) is missing. I cant tell from the message which is missing, though. When I have my next set of time dedicated to this hobby, Ill clean up some of that.

But yes, you should be able to use this from any generic Lua location. Use is like in this: lua-smtps/test.lua at master · slushpupie/lua-smtps · GitHub . Depending on what version of firmware you have, you might need to tell Lua where to find the module (see my earlier post about that).

I’ve been playing with this and originally saw the “attempt to concatenate a nil value” message as reported by others. I thought it was an issue with retrieving the variables (user, pass, etc). I couldn’t figure out how to edit/delete the variables, so I created a new smtps device (ID is 20). When I enterd the variables into this new device, I also entered “urn:slushpupie-com:serviceId:SmtpsAlert1” into the “New Service” field as I entered the “New variable” and “New value”. I also entered only one service/variable/value at a time and went through the cycle of saves/continues on each one.

The same error was still being generated, so I created an additional variable called “port” with a value of 465. To check the port I entered the following into a browser:
http://192.168.1.195:3480/data_request?id=variableget&DeviceNum=20&serviceId=urn:slushpupie-com:serviceId:SmtpsAlert1&Variable=port

The returned value was 465 as expected. I did a similar check for the other variables (user, pass, FromEmail) and all retured the expected values.

Now I get a different message in the logs:

JobHandler_LuaUPnP::RunAction device 20 action urn:slushpupie-com:serviceId:SmtpsAlert1/SendEmail failed with 401/Invalid service/action/device <0x2de07680>

I am hoping this error is due to an incorrect value I’ve entered, but I thought I would share the findings in the hope that someone else will benefit.

Hey slushpupie,

Any progress on this?

Thanks
-Kyle

Greetings to all of you,

Does anyone knows how to solve this error message?

01 06/17/12 19:16:08.285 LuaInterface::CallFunction_Job device 44 function SSmtpsAlert_SmtpsAlert1_SendEmail_run failed [string “…”]:17: attempt to concatenate a nil value <0x2e16d680>

I can’t get the SMTPS working. ???

Attached the logfile.