Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

sending email via Application Settings -> email setup does not work #1

Closed
jorikcaljouw opened this issue Jul 1, 2014 · 60 comments
Closed
Assignees
Labels

Comments

@jorikcaljouw
Copy link
Owner

reported by @unheilig:
as per email notifications (application settings -> email setup), I couldn't send any email although I was using a google account and following the same rules stated here: http://www.domoticz.com/wiki/Application_Settings. Any ideas?

@jorikcaljouw jorikcaljouw self-assigned this Jul 1, 2014
@jorikcaljouw
Copy link
Owner Author

I have not tried emailing myself, but maybe you can inspect the Log file for any error messages? You can find the Log file via DSM / Package Center.

@unheilig
Copy link

unheilig commented Jul 1, 2014

hi all,
log file for email sending attempt states the following:
image

it looks like it's trying to send an email to a "!" address (obviously I had a valid email address there). any ideas?

@jorikcaljouw
Copy link
Owner Author

That looks indeed as if the To: email cannot be accurately retrieved when sending the email. I believe there is a test-button for verifying email settings, does that work correctly? And can you see the valid email address in the settings page?

I will confirm tonight at home if it works for me with gmail settings.

@unheilig
Copy link

unheilig commented Jul 1, 2014

  1. yes there is a Test button that tries to do what it states (i assume it is working correctly, since test fails and a red message box appears);2) yes I can see my email displaying correctly in the edit field
    thanks!

----Messaggio originale----

Da: notifications@github.com

Data: 1-lug-2014 12.07

A: "jorikcaljouw/spksrc"spksrc@noreply.github.com

Cc: "unheilig"unheilig@libero.it

Ogg: Re: [spksrc] sending email via Application Settings -> email setup does not work (#1)

That looks indeed as if the To: email cannot be accurately retrieved when sending the email. I believe there is a test-button for verifying email settings, does that work correctly? And can you see the valid email address in the settings page?

I will confirm tonight at home if it works for me with gmail settings.


Reply to this email directly or view it on GitHub.

@jorikcaljouw
Copy link
Owner Author

This works correctly for me (gmail). I have entered the following details. The part that is blurred out is my gmail address:
screen shot 2014-07-02 at 00 58 45

@unheilig
Copy link

unheilig commented Jul 2, 2014

without any clue. my screen is the following
image.

please note that on the same Synology, email Notification works perfectly, and the configuration is the following:
image

@jorikcaljouw
Copy link
Owner Author

Can you double check there are no spaces before or after the email addresses? The error message in the log seems to indicate there are issues retrieving the to: emailaddress when sending the email. These settings should be stored in the database file if I'm not mistaken.

@unheilig
Copy link

unheilig commented Jul 2, 2014

checked. no spaces at all, before nor after.

some other strange behaviour:

  • my gmail configuration, on DS411+ of my friend is working fine,
  • his gmail configuration on my synology is not working at all.

it looks like I have some (network) problem in my Domoticz. what could be (assuming that everything else in DSM5.0 is running fine)?

@jorikcaljouw
Copy link
Owner Author

Ok, so your gmail config does work on his, but not on your NAS.
And his gmail config does also work on his, but not on your NAS? That could point to an issue with email sending for the architecture of your NAS.

Only thing I noticed is that you configured DSM to use port 465, while Domoticz is configured to use 587. Could you try the same port configuration in Domoticz to rule out it is related to your network situation?

@unheilig
Copy link

unheilig commented Jul 2, 2014

yes, mine on his is working fine. his config on mine is not working, as long as mine on mine!
I also tried to use 465 on Domoticz, but it didn't work at all.

I noticed that the Red box with the error message ("please check your credentials") is (sometimes) also appearing on my friend's NAS (DS411+ x86), but working fine

(i'm going crazy).

Maybe a JSON trouble on my compiled version?

@unheilig
Copy link

unheilig commented Jul 4, 2014

Hi Jorik,
any idea on this issue? it looks like it's related to the particular version compiled for my model.
or maybe some missing JSON component?

@unheilig
Copy link

hi guys,
one update on this. It looks like that in this compiled version of Domoticz it is not able to send emails due to a conversion of email addresses.

Indeed, "@" sign is converted into %40 and maybe the command that is executed to send email can't catch the correct email address since it contains some "garbage"

please have a look at the image (the example is related to an API notification (PUSHOVER service).

image

Indeed if I try to use PRAWL, that requires no userid authentication but the API key, notification is working correctly.

PLEASE HELP! thank you!

@jorikcaljouw
Copy link
Owner Author

Hi @unheilig,
sorry for the radio silence, I have been rather busy with other things and have not done much with the spksrc. I must say the lack of feedback from SynoCommunity for the pull request does not really motivate me... Anyway, %40 is the way to write @ with urlencoding. If the @ is somehow not correctly sent or stored by some browser setting, could you do some debugging with other browsers or other settings and see if that helps? If this is a bug, it is something that needs to be fixed by the domoticz developers(s), like gizmocuz. I wouldn't know where to start solving this ;-). And it would be helpful if they can reproduce the problem on their end, by using some specific browser and settings.

BTW, I have updated the Makefile for the latest revision (1853) and it still seems to build and work correctly on my computer. I am building all archs that used to work to verify if anything else breaks.

@unheilig
Copy link

unheilig commented Aug 1, 2014

hi Jorik,
thank you for your reply. Yes, I've tried also with other browsers (chrome, firefox, opera, ie), but I always get the same issue. no e-mail notifications are sent (and the error message it's always the following)

image

Moreover, it often happens that domoticz hangs and crashes, and has to be stopped-restarted.

I can confirm that it works perfectly on the x86 compiled version, regardless of browser/charset;

Maybe @gizmocuz can verify what could be wrong in the notification settings (mainly the SMTP configuration to send emails?)

thank you very much

@unheilig
Copy link

unheilig commented Aug 1, 2014

hi Jorik,

do you think there are some benefits in trying the latest revision (1853)?
would you be so kind to recompile for the DS213 (marvel kirkwood)?

thank you in advance

@jorikcaljouw
Copy link
Owner Author

I didn't see anything in the changelogs that would indicate your issue would be resolved, but you never know ;-). I could be mistaken, but domoticz_88f6281_1853-1.spk is the right arch for the DS213, right?

It would also be good if you could verify that upgrading the package works correctly. It did seem to work correctly for me and I have investigated that copying the database for the upgrade should happen correctly. Nonetheless you may want to create a manual backup from the web interface to be sure.

@unheilig
Copy link

unheilig commented Aug 1, 2014

Yes, I had the "domoticz_88f6281_1812-1.spk" compiled for my DS213, that's right.
I will verify also the upgrade of the package, along with backuping/restoring the database.

thank you! let me know how to get the compiled version then!

G

@jorikcaljouw
Copy link
Owner Author

Oh, sorry, I thought the link I sent earlier would point you to the folder with both revisions, if it did not, this link should work:
https://www.dropbox.com/sh/hlf95h3lfq3tdht/AADWfUok2b4BZPaXMJgzyTxOa/SynoTestPackages

@unheilig
Copy link

unheilig commented Aug 1, 2014

hi.
upgraded the version without any trouble.
No data was lost.

and, unfortunately, no fix were made for the email notifications to work. :(

@Schim9
Copy link

Schim9 commented Aug 6, 2014

Hi,

My Syno is configured to send me e-mail notification through Gandi.net
image

If I set the same thing in Domoticz
image
=> Check your credential
image

Same issue for Pushover Android. I tried the UserID with @ and %40 but nothing work.
I created an application and I put the APITokenKEy
image

Unsuccessfull.

But the NMA notification is working.

@unheilig
Copy link

unheilig commented Aug 6, 2014

yes, same issue as mine.
looks like NMA is working just because Domoticz doesn't handle ANY email address.. :(

@jorikcaljouw
Copy link
Owner Author

According to people in the domoticz forum this should be resolved in rev 2029. I'll create a package with the latest rev. on Sunday.

@jorikcaljouw
Copy link
Owner Author

I have added a package with rev 2042 for your arch to the same folder:
https://www.dropbox.com/sh/hlf95h3lfq3tdht/AADWfUok2b4BZPaXMJgzyTxOa/SynoTestPackages
Could you give it a try?

@unheilig
Copy link

unheilig commented Oct 6, 2014

Hi Jorik, thanks for your work.

I've just installed rev 2042 but unfortunately when trying to send an email Domoticz hangs infinitely, without returning a response.
It also hangs the Web UI of all the DSM.

I'm going to test it again trying to change the smtp server/ port (at the moment I'm using smtp.gmail.com and port 465)

thank you, please let's keep in touch

@jorikcaljouw
Copy link
Owner Author

Hmm, that does not sound good. I will test the same package on my DiskStation tonight, but I would find it very strange if this application could cause DSM to not respond anymore.

@unheilig
Copy link

unheilig commented Oct 6, 2014

I suppose it's the whole browser (Chrome) that hangs, not the DSM itself...
anyway please have a look at email notification procedure.

thank you!

@Schim9
Copy link

Schim9 commented Nov 3, 2014

I have installed domoticz_88f6281_2042-4.spk on my DS410J.
The DSM is DSM 5.0-4493 Update 3 from 19/07/2014.

Does that answer you ?

In my test I have set the Gandi mail server (webmail.gandi.net:25)

@unheilig
Copy link

unheilig commented Nov 3, 2014

hi @Schim57300, so we run the same spk on the same DSM os.
the only thing that differs as per this issue is the smtp server, i'm using smtp.google.com:465 but it doesn't work. I've also tried port 25 and 587, but It didn't worked.

are you able to try with smtp.google.com:465?

thank you

@Schim9
Copy link

Schim9 commented Nov 3, 2014

I have just tried with my google account and it does not work.
=> smtp.google.com:25
=> smtp.google.com:465

Maybe the problem come from Gmail...

@jorikcaljouw
Copy link
Owner Author

Outgoing connection on port 25 to smtp servers outside your ISP network will typically not work, because all ISP's that I know block it to prevent spam. I believe Gmail requires encryption (TLS or SSL) for ports 465 and 587, which could fail if something was not compiled correctly with SSL support. Would it be possible to test this with an SMTP server by your internet provider which will probably accept emails sent to port 25?

@Schim9
Copy link

Schim9 commented Nov 3, 2014

For me it work on port 25 through the Gandi smtp server :
image

@unheilig
Copy link

unheilig commented Nov 3, 2014

unfortunately it seems that the only smtp server that I'm able to use (smtp.tiscali.it) with port 25 is not working for the notifications:

image

any ideas?

@Schim9
Copy link

Schim9 commented Nov 3, 2014

Sorry I won't be able to try with another mailbox :-\

If I would encounter another problem with this release (that I didn't with the previously installed one) where should I describe it ? It is not related to Notifications....

Thanks

@gizmocuz
Copy link

gizmocuz commented Nov 3, 2014

most ISPs do NOT allow connecting to port 25 from outside your home connection, could this be it?
Or use google, and let google forward te mail to you

@Schim9
Copy link

Schim9 commented Nov 3, 2014

I confirm in France some ISP prevent the use of the port 25 to send e-mail (Orange...)

@unheilig
Copy link

unheilig commented Nov 4, 2014

hi @gizmocuz, using google smtp won't help, since SSL authentication is not working in version 2042-4.
or you meant something different?

@gizmocuz
Copy link

gizmocuz commented Nov 4, 2014

There have been people using gmail since the more then a year, it should work

@Schim9
Copy link

Schim9 commented Nov 4, 2014

Excuse me to be off-topic but it seems there is an issue with the package domoticz_88f6281_2042-4.spk
When Domoticz is started, the /usr/local/domoticz/www folder contains .gz files instead of .js
image

If you activate the secure remote access you will have a lot of error in your browser
image

I had to run the following commands :
Cd /usr/local/domoticz/www/
find . -name *.gz
gunzip –r *

I still had error related to 4 angular files. I did :
Cd /usr/local/domoticz/www/js
cp angular-animate.min.js angular-animate.min.js.map
cp angular.min.js angular.min.js.map
cp angular-route.min.js angular-route.min.js.map
cp angular-sanitize.min.js angular-sanitize.min.js.map

I still have an issue when I connect myself via my local network but I think it is related to my Synology firewall configuration :
image

When I am really away everything work successfully.
Even Dromotica

Schim'

@gizmocuz
Copy link

gizmocuz commented Nov 4, 2014

You should not do this, the .gz files are send over with a gzip HTTP header to the client, this has been working for year(s) now, so no need to unpack them
If you use another webserver then the build in, maybe you have a problem, but thats not a domoticz problem

@unheilig
Copy link

unheilig commented Nov 4, 2014

unfortunately @gizmocuz gmail doesn't work.

can you probe that smtp.google.com:465 or 587 is sending email correctly?

@jorikcaljouw do you think it is possible to investigate in SSL authentication for email sending?

@Schim9
Copy link

Schim9 commented Nov 4, 2014

@gizmocuz ,
Thank you for your answer. I used to have the domoticz_88f6281_1853-1.spk with no problem.
Yesterday I have installed the domoticz_88f6281_2042-4.spk and it does not work without gunzip on your .js files.

Maybe I have done something wrong.

@jorikcaljouw
Copy link
Owner Author

There were a couple of improvements made between 1853-1 and 2042-4. I'm not sure if upgrading directly from the old to the new works 100% correctly. Could you maybe backup the database manually (from Domoticz itself), then remove the Domoticz package and install 2042-4? Then reload the database manually?

@jorikcaljouw
Copy link
Owner Author

@unheilig if non-SSL to your ISP SMTP server also does not work, I think we should be looking into this before looking into SSL issues. I wonder if it would be easy to log all data that is actually sent via SMTP with wireshark or something similar.

@unheilig
Copy link

unheilig commented Nov 4, 2014

@jorikcaljouw yes, also port 25 is not working, you're right.
i will try to investigate with tshark, and please if you have news about smtp email sending please advice

thank you

@Schim9
Copy link

Schim9 commented Nov 4, 2014

@jorikcaljouw I did uninstall the package yesterday. Then I installed the new one.

I do not understand why that does not work. Maybe I should try a previsous version.

@Schim9
Copy link

Schim9 commented Nov 5, 2014

For your information my problems are solves.
By switching the security settings to Basic Auth, I do not have any js exception anymore.
image

My Domoticz server works correctly on my Synology :

  • accessing the website from everywhere with several browser (IE, Chrome, Android browser)
  • scheduling blinds closure and opening
  • sending mail notification throught my Gandi webmail
  • Managing the devices and executing scenes via Dromotica on my smartphone.

It remains an issue when I want to list devices on Andromoticz. A mail has been sent to the support :-)

@jorikcaljouw : Do you need me to test anything else ?

Current release : domoticz_88f6281_2020-4.spk

Schim'

@unheilig
Copy link

unheilig commented Nov 5, 2014

hi @Schim57300, I've tried your suggestion as per login method, but unfortunately nothing changed by my side.

@Schim9
Copy link

Schim9 commented Nov 5, 2014

Changing the loging method has solved my "js exception" problem.
Your problem is related to the mail notification isn't it ? Or do you have also remote connection problem?

Regarding the notifications, would it help you if I would create a dummy mailbox on my gandi account and I provide you with the connection identifiers ? You would be able to try the notification on your side :-\

@unheilig
Copy link

unheilig commented Nov 5, 2014

@Schim57300 that could be a great idea to deal with. you can email me at unheilig at libero dot it.

thank you!

@Schim9
Copy link

Schim9 commented Nov 5, 2014

done.

@unheilig
Copy link

unheilig commented Nov 5, 2014

As stated by @Schim57300, email notification through smtp port 25 works with Domoticz!
thank you!

so it could be useful to understand why SSL authentication is not properly working...

@gizmocuz
Copy link

gizmocuz commented Nov 5, 2014

Make take out the code, build a small test app with it ? And debug line by line
You could use codelite for IDE for example, or qt creator

@jorikcaljouw
Copy link
Owner Author

I am making some last small changes to my fork of spksrc for domoticz, then I will create a PR and then I'm closing my fork. In this time frame I will not be looking into possible SSL issues on 88f6281. Hence closing this issue in this fork

@gizmocuz
Copy link

gizmocuz commented Feb 3, 2015

latest svn version now has SSL build in

@unheilig
Copy link

unheilig commented Feb 3, 2015

ssl-tls on port 587 runs smoothly.
thank you for your work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants