LinuxMCE Forums

General => Users => Topic started by: d4rr3ll on June 10, 2011, 11:28:50 am

Title: How to setup Mailx? (Newbie)
Post by: d4rr3ll on June 10, 2011, 11:28:50 am
Hi,

I'm dipping my toe into the world of linuxmce and have it hanging together with a couple of devices (Foscam, and ZWave PIR).  But I'm struggling to figure out how to get Mailx up and running so I can send out alerts.  Searching the forums I can find a couple of mentions about 'adding mailx as a top level device' but how do I actually do that?  I have email configured and the test message is sent to my gmail account, but I'm missing this last piece in the puzzle.

Any help would be appreciated.

Regards
Darrell.
Title: Re: How to setup Mailx? (Newbie)
Post by: tschak909 on June 10, 2011, 12:23:21 pm
Currently, the mailx device must be manually added to the device tree.

In the future, the Wizard > Devices > Core page in the web admin, will provide a place where you can quickly enable/disable mailx, but for now:

* Go to the web admin,
* Advanced > Configuration > Devices, select the CORE device
*click add child device, on the right.
* in the device template drop down, find and select the Mailx device.
* select Pick Device template.

The device and its associated packages and driver will then be installed.

You can then interact with the device in scenarios and events as needed.

-Thom
Title: Re: How to setup Mailx? (Newbie)
Post by: Marie.O on June 10, 2011, 01:54:40 pm
I took the liberty and copied Thom's information into a wiki entry http://wiki.linuxmce.org/index.php/Email_Events_And_Scenarios
Title: Re: How to setup Mailx? (Newbie)
Post by: d4rr3ll on June 12, 2011, 12:39:15 pm
Thanks Thom for the information but I'm stuck at step 3 - 'select the mailx device', I don't have this in the menu.  Mailx is installed on the box:

darrell@dcerouter:~$ sudo dpkg --get-selections | grep mailx
bsd-mailx               install
mailx                  install

How do I get Mailx to appear in that menu?

Thanks
Darrell
Title: Re: How to setup Mailx? (Newbie)
Post by: slampt on June 12, 2011, 01:39:56 pm
FWIW,


When I try this I receive this error in the Launch Manager Logs

05   06/12/11 19:37:52.945      Not starting device 230 Mailx -  binary "Mailx" is not found. <0xb7108b90>

And none of my test email events function.

Slampt
Title: Re: How to setup Mailx? (Newbie)
Post by: Marie.O on June 12, 2011, 02:04:00 pm
Thanks Thom for the information but I'm stuck at step 3 - 'select the mailx device', I don't have this in the menu. 

It is device template 2120. You should find it in the drop down list, if you selected the CORE.
Title: Re: How to setup Mailx? (Newbie)
Post by: d4rr3ll on June 13, 2011, 07:21:56 pm
OK, I found template 2120 (Mailx), not sure how I missed it before I'm convinced I stepped through every 'M' in the list, anyway I'm one step further but am now at my next stumbling block. 

Whenever I try to add a mailx command and use the 'Test command' button no email is sent, nothing happens in mail.log, so I had a fish around and found entries like this in /var/log/pluto/webExecLog.log.... (I've remove my email address)

13-06-2011 18:11:55     /usr/pluto/bin/MessageSend dcerouter -targetType device 0 51 1 1075 283 Kitchen camera triggered 282 **hidden**@gmail.com
13-06-2011 18:12:19     /usr/pluto/bin/MessageSend dcerouter -targetType device 0 51 1 1075 283 Kitchen camera triggered 282 **hidden**@gmail.com
13-06-2011 18:14:33     /usr/pluto/bin/MessageSend dcerouter -targetType device 0 51 1 1075 284 Test 283 Kitchen camera triggered 282 **hidden**@gmail.com

So it looks like the 'Test command' does something, but I'm still not seeing anything in the mail.log.... so I cut and paste the above command into a shell (root) and got the following...

darrell@dcerouter:~$ /usr/pluto/bin/MessageSend dcerouter -targetType device 0 51 1 1075 284 Test 283 Kitchen camera triggered 282 **hidden**@gmail.com
01      06/13/11 18:16:06.867           Message constructor malformed with wrong param id 'camera'

So I tried with quotes, i.e.

darrell@dcerouter:~$ /usr/pluto/bin/MessageSend dcerouter -targetType device 0 51 1 1075 284 Test 283 'Kitchen camera triggered' 282 **hidden**@gmail.com

no errors this time, but still nothing in mail.log

Where should I be looking next?






Title: Re: How to setup Mailx? (Newbie)
Post by: d4rr3ll on June 17, 2011, 01:43:02 am
Bump.