A more generic e-mail app!

This is a collection of wishes and needs for the next versions of Z-Way/Z-Cloud/Z-Box
l11
Posts: 1
Joined: 20 Mar 2016 12:14

A more generic e-mail app!

Post by l11 » 20 Mar 2016 12:20

It would be great if someone could make a messaging app for the razberry operative. I would love if there was a small sendmail server on the pi that could send mail to me on events. Same for sms but I realize that could be a cost issue. But maybe it could send to whatsapp and other message apps?
It's not only about controlling the house, we also need some better passive feedback from the house as well

what do you say? Good idea?

User avatar
PoltoS
Posts: 3416
Joined: 26 Jan 2011 19:36

Re: A more generic e-mail app!

Post by PoltoS » 28 Jul 2016 21:07

This is a big challange. Since most of mails from Pi will end up in spam. We are designing a mailing service for this.

icebrian
Posts: 18
Joined: 27 Feb 2013 02:54

Re: A more generic e-mail app!

Post by icebrian » 12 Dec 2016 04:48

Why not have an app that would allow for the configuration of an SMTP server? One could for example simply configure a gmail account for outgoing e-mail, therefore avoiding spam filters.

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: A more generic e-mail app!

Post by pz1 » 12 Dec 2016 12:05

icebrian wrote:Why not have an app that would allow for the configuration of an SMTP server? One could for example simply configure a gmail account for outgoing e-mail, therefore avoiding spam filters.
Did you have a look at the Email app that has been added to the App-store again acouple of days ago:
Attachments
Capture.PNG
Capture.PNG (26.11 KiB) Viewed 1134 times

icebrian
Posts: 18
Joined: 27 Feb 2013 02:54

Re: A more generic e-mail app!

Post by icebrian » 12 Dec 2016 20:35

I did indeed, and I am using it. Works great, however, it is using an SMTP server by z-wave.me and am concerned this won't be scalable as also e-mails are preformatted with content that does not belong to me, ergo my comment on having an app that would allow for the configuration of an SMTP server.

Is there may-be someway in which I can change the SMTP server for the "E-mail ME" app?

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: A more generic e-mail app!

Post by pz1 » 12 Dec 2016 21:00

If you look into the index.js file of the app, below "--- Module metrics" you find the present code. It is not just replacing a SMTP url I think.
I agree it would be nice to use your own SMTP.

icebrian
Posts: 18
Joined: 27 Feb 2013 02:54

Re: A more generic e-mail app!

Post by icebrian » 13 Dec 2016 01:20

Yeap found it. I actually changed "url: "https://service.z-wave.me/emailnotification/"," to point to a PHP of my own server that received POST's and sends an e-mail, however, it seems that changes that I make on index.js are ignored.

When testing, all emails where still being sent via z-wave.me mail servers. Might you know if there is some cache that might need cleaning so that changes are reflected?

pz1
Posts: 2053
Joined: 08 Apr 2012 13:44

Re: A more generic e-mail app!

Post by pz1 » 13 Dec 2016 12:36

In principle it is neccessary to restart your z-way service (or reboot your pi). If you did that, I don't know why it is still using the same email service

icebrian
Posts: 18
Joined: 27 Feb 2013 02:54

Re: A more generic e-mail app!

Post by icebrian » 14 Dec 2016 01:25

Indeed that was it. I restarted and it worked. So for documentation purposes here is what I did:

Edited file /opt/z-way-server/automation/userModules/MailNotifier/index.js and changed line 106 from:

Code: Select all

url: "https://service.z-wave.me/emailnotification/",
To:

Code: Select all

url: "https://myserver.com/emailnotification/",
And then in my own server I have the following PHP (with mailserver correctly configured):

Code: Select all

<?php

$email_to = $_POST['mail_to'];
$email_from = "myemail@mydomain.com";

$email_subject = '[home@'.date("Ymd").'-'.date("H:i").'] '.$_POST['subject'];

$email_message = $_POST["message"]."\n\n".
'<p><i><font size="2">Event generated on '.date("Y-m-d").' at '.date("H:i").'</font></i></p>';

#// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion()."\r\n".
'Content-Type: text/html; charset=UTF-8';

@mail($email_to, $email_subject, $email_message, $headers);

?>
Now, as is, it is obviously a serious security risk, as it would allow anyone to send e-mail via my server, so I don't recommend using as is.

A quick fix could be hard codding the TO value with an e-mail, which could however result in an e-mail flood.

enbemokel
Posts: 73
Joined: 08 Aug 2016 17:36

Re: A more generic e-mail app!

Post by enbemokel » 15 Dec 2016 18:39

Nice Link:

https://service.z-wave.me/emailnotification/

I have the feeling not to use this app or this service, as there are some logfiles in the service.z-wave.me server
that are open to public. Mailed this yesterday to the forum admin but no reaction. :-(

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest