Please login or register.

Login with username, password and session length
Pages: [1] 2 3

Author Topic: HG email not sending  (Read 9788 times)

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
HG email not sending
« on: February 24, 2019, 12:16:12 PM »

So I assume I have the known 'certificate' issue in mono that prevents email from sending from HG.

I have latest HG (.37), supposed proper mono (ver 5.4.0.201), have done update/upgrade, but still no email sending.  HG log reports:

2019-02-24 11:52:07.1672 Trace SendMessage: going to send email System.Net.Mail.MailMessage using mailService 'smtp.gmail.com', port '465', credentials System.Net.NetworkCredential, using SSL = True

then:

2019-02-24 11:52:17.4956 Trace SendMessage: error sending email {0}
2019-02-24 11:52:17.5003 Error System.Net.Mail.SmtpException: Message could not be sent. ---> System.IO.IOException: Connection closed
  at System.Net.Mail.SmtpClient.Read () [0x000bd] in <8a8abae728c244359683ef777047ab9e>:0
  at System.Net.Mail.SmtpClient.SendCore (System.Net.Mail.MailMessage message) [0x00000] in <8a8abae728c244359683ef777047ab9e>:0
  at System.Net.Mail.SmtpClient.SendInternal (System.Net.Mail.MailMessage message) [0x00050] in <8a8abae728c244359683ef777047ab9e>:0
  at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x00084] in <8a8abae728c244359683ef777047ab9e>:0
   --- End of inner exception stack trace ---
  at System.Net.Mail.SmtpClient.Send (System.Net.Mail.MailMessage message) [0x0009f] in <8a8abae728c244359683ef777047ab9e>:0
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x003f1] in <b08d74f9b7fb4c85b616d2d9beee8275>:0
2019-02-24 11:52:17.5211 Error HomeAutomation.HomeGenie.Automation
  at HomeGenie.Automation.Scripting.NetHelper.SendMessage (System.String from, System.String recipients, System.String subject, System.String messageText) [0x003f1] in <b08d74f9b7fb4c85b616d2d9beee8275>:0
2019-02-24 11:52:17.5225 Trace SendMessage: disposing smtpClient
2019-02-24 11:52:17.5264 Trace SendMessage: called for recipients mike@kilroywashere.com
2019-02-24 11:52:17.5310 Trace SendMessage: getting smtpSyncLock
2019-02-24 11:52:17.5323 Trace SendMessage: got smtpSyncLock
2019-02-24 11:52:17.5378 Trace SendMessage: going to send email System.Net.Mail.MailMessage using mailService 'smtp.gmail.com', port '465', credentials System.Net.NetworkCredential, using SSL = True

I assume this is the certificate issue in mono so often spoken about? 

I have tried non gmail account for my smtp sender and same thing.

I try the certificate update command:

pi@raspberrypi:~ $ sudo apt-get install ca-certificates-mono
Reading package lists... Done
Building dependency tree
Reading state information... Done
ca-certificates-mono is already the newest version (5.4.0.201-0xamarin10+raspbian9b1).
ca-certificates-mono set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

So that does not do it.

ANY CLUES WHERE I SHOULD LOOK NEXT TO GET WORKING EMAIL?
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #1 on: February 24, 2019, 01:14:07 PM »

More searching found this at old.homegenie.club
 Topic: Errors after 447->493 update - help please  (Read 3731 times)

After mono install:
1. cert-sync /etc/pki/tls/certs/ca-bundle.crt
2. certmgr -ssl -m smtps://smtp.gmail.com:465 (and say "y" to all questions)
3. restart homegenie

Email Account program in homegenie settings:
1. E-Mail address: <email>@gmail.com
2. SMTP Mail Server address: smtp.gmail.com
3. SMTP username: <email>@gmail.com
4. SMTP password: <app specific password since I'm using 2 step verification>
5. SMTP Mail Server port: 587
6. SMTP Mail Server use SSL: TRUE


So tried it:

pi@raspberrypi:~ $ cert-sync /etc/pki/tls/certs/ca-bundle.crt
Unknown option or file not found '/etc/pki/tls/certs/ca-bundle.crt'.
Mono Certificate Store Sync - version 5.4.0.201
Populate Mono certificate store from a concatenated list of certificates.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.

Usage: cert-sync [--quiet] [--user] system-ca-bundle.crt
Where system-ca-bundle.crt is in PEM format

So that command doesn't work...

next:

pi@raspberrypi:~ $ certmgr -ssl -m smtps://smtp.gmail.com:465
Mono Certificate Manager - version 5.4.0.201
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.


X.509 Certificate v3
   Issued from: OU=GlobalSign Root CA - R2, O=GlobalSign, CN=GlobalSign
   Issued to:   C=US, O=Google Trust Services, CN=Google Internet Authority G3
   Valid from:  15/06/2017 00:00:42
   Valid until: 15/12/2021 00:00:42
   *** WARNING: Certificate signature is INVALID ***
Import this certificate into the CA store ?y
Access to the machine '' certificate store has been denied.


OK, step 2 didn't work...

I am no further along yet to making email work in HG...
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #2 on: February 24, 2019, 01:18:17 PM »

maybe sudo:

pi@raspberrypi:~ $ sudo certmgr -ssl -m smtps://smtp.gmail.com:465
Mono Certificate Manager - version 5.4.0.201
Manage X.509 certificates and CRL from stores.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.


X.509 Certificate v3
   Issued from: OU=GlobalSign Root CA - R2, O=GlobalSign, CN=GlobalSign
   Issued to:   C=US, O=Google Trust Services, CN=Google Internet Authority G3
   Valid from:  15/06/2017 00:00:42
   Valid until: 15/12/2021 00:00:42
   *** WARNING: Certificate signature is INVALID ***
Import this certificate into the CA store ?y

X.509 Certificate v3
   Issued from: C=US, O=Google Trust Services, CN=Google Internet Authority G3
   Issued to:   C=US, S=California, L=Mountain View, O=Google LLC, CN=smtp.gmail.com
   Valid from:  29/01/2019 14:59:18
   Valid until: 23/04/2019 14:59:00
Import this certificate into the AddressBook store ?y

2 certificates added to the stores.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #3 on: February 24, 2019, 02:23:59 PM »

Tried yahoo account & pi@raspberrypi:~ $ sudo certmgr -ssl -m smtps://smtp.mail.yahoo.com:465


still no go. 
Logged

racerfern

  • Hero Member
  • *****
  • Helpful Post Rating: 6
  • Posts: 275
Re: HG email not sending
« Reply #4 on: February 24, 2019, 02:58:48 PM »

This has been an on going issue for some Homeseer users as well. I believe it has something to do with two factor authorization. I gave up trying to use Gmail with homeseer and now use an email address from my ISP provider, Optimum.

You might want to do a search on the homeseer forum.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #5 on: February 24, 2019, 03:13:53 PM »

Thanks racerfern.  I have tried gmail, yahoo and my own server.  All fail with the same wierd error.
Logged

racerfern

  • Hero Member
  • *****
  • Helpful Post Rating: 6
  • Posts: 275
Re: HG email not sending
« Reply #6 on: February 24, 2019, 04:34:52 PM »

Lots of discussions about this for win, mac and pi.

Googled, "Access to the machine certificate store has been denied. raspberry pi"

Lots of suggestions, not sure if I actually saw a solution.
Logged

petera

  • PI Expert
  • Hero Member
  • ******
  • Helpful Post Rating: 27
  • Posts: 1751
Re: HG email not sending
« Reply #7 on: February 24, 2019, 04:38:15 PM »

You don't need to add certs to Mono since v5x. Change your port no to 587 and make sure you have ticked the SSL option in HG. Use the spacebar to make sure the tick shows in the box.

Be careful when installing things like certs in Raspbian. You need to do that as a super user (sudo). Unless otherwise mentioned most of the Linux instructions in the old HG forum do not refer to Raspbian so they tend not to include the sudo command in front of the install instructions.
Logged

brobin

  • Hero Member
  • *****
  • Helpful Post Rating: 160
  • Posts: 1458
Re: HG email not sending
« Reply #8 on: February 24, 2019, 05:03:39 PM »

I have no idea if this will be helpful but as time went on and email services became more secure, my Stargate could no longer send emails because it couldn't handle SSL and there was no upgrade.  My solution was to create a free account at https://www.smtp2go.com/ and send emails using port 2525 without SSL. As I said, this may have nothing to do with the issue at hand but might be worth a look. The free outgoing mail allowance is quite generous at 500 per month.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #9 on: February 25, 2019, 03:44:11 PM »

Thanks brobin!  I too have a non-ssl email account and it too does not work so my issue must be something else.  I have made a new SD card with latest tuicemen SD image;  I will try it soon oon another pi I have around here.
Logged

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #10 on: February 25, 2019, 03:45:23 PM »

Thanks petera for your comment.  No one else seems to have known mono 5.0 and great no longer need certmgr.  I keep learning a tidbit at a time.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: HG email not sending
« Reply #11 on: March 11, 2019, 01:45:29 PM »

@mike, I admire you for all the time you've spent on this. Myself I would have uninstalled HG and started fresh long ago.
I made a script that removes the current version of HG and then installs 1.2-stable.30 some time ago.

It may help you as it will put a fresh install of HG on your pi so you can start a new without the need for a new image. You only need to have a HG backup file to restore to. This will put HG on port 80 unless you have something else running on that port like HA-Bridge. If you think you can use this let me know and I'll post a copy. ;)
 >!
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #12 on: March 11, 2019, 02:11:14 PM »

Please post, thank you.  Yes, I will try it.  And I DID start fresh - downloaded your latest x10user image, burned it, installed it on a separate pi running on my system.  It too will not send - same issue:  HG remembers the FIRST email Account info entered and never again overwrites it, no matter how many times the options screen is changed. 

As HG is potentially open source, if I knew how to download the HG source code I would attempt to decode where the program fault is that does not allow rewriting this info.

Starting from ground 0 again and doing exactly the same thing again is not worth it for me as I am sure I would get the same result.

Starting from a script that only screws up HG is worth a try.

Thank you.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10509
  • I don't work for X10, I use it successfuly!
Re: HG email not sending
« Reply #13 on: March 11, 2019, 02:25:46 PM »

well the script doesn't screw up HG it removes all instances of HG on your Pi then rebuild it installing 1.2-stable.30
I believe I had read you did get email working at one point but either adding your backup or reimaging you lost it.
You can download the current version code of HG by clicking on the green "Clone or download" button right of the GitHub page
In any case the Revert script is attached download it and rename it to "Revert" place it in the home/pi folder.
to utilize and run it from putty be sure your in the Home/pi folder and type sh Revert
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

mike

  • Hero Member
  • *****
  • Helpful Post Rating: 14
  • Posts: 1057
Re: HG email not sending
« Reply #14 on: March 11, 2019, 02:51:16 PM »

yes, it worked ONCE - UNTIL I REBOOTED THE PI.

Tried Revert:

pi@X10Hub:~ $ sh Revert
homegenie.service is not a native service, redirecting to systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable homegenie
rm: cannot remove '/etc/systemd/system/homegenie.service': No such file or directory
dpkg: error: dpkg status database is locked by another process
Revert: 10: Revert: Syntax error: "else" unexpected (expecting "then")



EDIT:  There is no homegenie.service in that directory here...  This is your latest non beta SD image
« Last Edit: March 11, 2019, 02:54:12 PM by mike »
Logged
Pages: [1] 2 3
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.