edgex-go: Notification is failed to send emails

🐞 Bug Report

Affected Services

The issue is located in: edgex-support-notification

Description and Minimal Reproduction

Following the document(https://docs.edgexfoundry.org/Ch-AlertsNotifications.html), I tried both methods to configure the mail service for yahoo. However, it’s failed to send notifications.

🔥 Exception or Error

Got the error: level=ERROR ts=2019-10-30T09:01:15.749333Z app=edgex-support-notifications source=sending_service.go:98 msg="Problems sending message to: abc@gmail.com, issue: x509: certificate signed by unknown authority

error-x509

🌍 Your Environment

Deployment Environment:

**EdgeX Version: Fuji **Smtp Host: smtp.mail.yahoo.com **Smtp Port: 587 **Smtp Sender: abc@yahoo.com **Smtp Password: mypassword **Smtp Username: abc@yahoo.com

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 24 (24 by maintainers)

Most upvoted comments

I was finally able to reproduce this by running the whole environment in Docker.

level=ERROR ts=2019-11-10T21:04:11.7886936Z app=edgex-support-notifications source=sending_service.go:98 msg="Problems sending message to: trevor.conn@gmail.com, issue: x509: certificate signed by unknown authority"

The error above is caused by the root certificates not being in the docker image. Once I made the Dockerfile changes to get that done Dockerfile.WithCerts.txt, I encountered another error.

level=ERROR ts=2019-11-10T22:11:34.3823424Z app=edgex-support-notifications source=sending_service.go:99 msg="Problems sending message to: <my-email>@gmail.com, issue: line 203: 530 5.5.1 Authentication Required. Learn more at\n5.5.1  https://support.google.com/mail/?p=WantAuthError o203sm4389876oia.4 - gsmtp"

This is confusing to me because I copied my credentials into the docker configuration.toml from the local configuration.toml, so I know they’re present and correct. I don’t know why this wouldn’t work in a Docker-ized deployment, however it works natively. I suppose it could have something to do with how the data is being encrypted by the container that the destination server can’t read it.

@AnthonyMBonafide @rudderfree It looks like this issue is related to https://github.com/edgexfoundry/edgex-go/pull/1565. Your help in resolving would be appreciated.

@jinlinGuan At the outset (and we can discuss in realtime once you can please respond to my EdgeX Slack chat message) I want to compare notes with you regarding 3.2.1.6. Configure Mail Server in connection with the Yahoo Mail setup (in relation with the setting(s)EnableSelfSignedCert = false and EnableSelfSignedCert = true) . I am now going through the corresponding setup for Gmail