RocketChat / Rocket.Chat

The communications platform that puts data protection first.
https://rocket.chat/
Other
40.19k stars 10.39k forks source link

Sending emails from sandstorm #5883

Closed zeigerpuppy closed 7 years ago

zeigerpuppy commented 7 years ago

Rocket.Chat Version: 0.49.3 (Sandstorm)

I know that this may be a more general powerbox issue, but thought it was worth filing here anyway for others that may stumble upon it. Currently sending email via SMTP from within Sandstorm Rocket.Chat is non-functional. This means you can't use email notifications.

To test: 1) edit the current user profile and set an email address 2) edit the Administration>>Email settings I entered a valid SMTP server.

The error received when pressing "Send a Test Mail to My User" is:

Error
Error trying to send email: 
getaddrinfo ENOTFOUND smtp.mymailserver.net
smtp.mymailserver.net

ps. I just found this advice on sandstorm email https://docs.sandstorm.io/en/latest/administering/email/

looks like I may have a misconfigured outgoing relay, I'll comment back with a fix...

engelgabriel commented 7 years ago

@kentonv can you give @zeigerpuppy a help here?

kentonv commented 7 years ago

Rocket.Chat does not currently use the appropriate Sandstorm APIs for sending e-mail, so e-mail won't work.

One solution could be to modify Rocket.Chat to use the e-mail APIs.

However, since the e-mail is being sent for notification purposes, it may make more sense to rely on Sandstorm's notification system here. In this case, Rocket.Chat should simply hide the e-mail config in its interface. Rocket.Chat already uses the Sandstorm notification API, so no new code is needed there. Sandstorm currently does not support sending e-mails on notifications, but we intend to add such support. Users would then be able to control what kind of notifications they receive via the Sandstorm UI rather than inside Rocket.Chat.

engelgabriel commented 7 years ago

@sampaiodiego can you please hide all the email setting on the Sandstorm build script?