gristlabs / grist-core

Grist is the evolution of spreadsheets.
https://www.getgrist.com
Apache License 2.0
7.25k stars 321 forks source link

feature request: smtp settings for self hosted installation #146

Open helmut72 opened 2 years ago

helmut72 commented 2 years ago

There is an option to invite people by typing a mail address: we'll email an invite to ... But there is no option to configure a smtp server.

I don't have tried it, because I don't want to share my mail address and the senders mail address to unknown, also I want to avoid that my public ip address comes to a spamlist because Gist includes an own mail relay engine with unknown/bad settings.

Thank you.

paulfitz commented 2 years ago

Hi @helmut72, I understand your concern. There won't be any emails sent. When you invite users to a document, they will have access to that document if they log in, but won't receive an email. A event will be generated within Grist (here https://github.com/gristlabs/grist-core/blob/f224afcc6260d66e0182da30bf8d5e81348d000d/app/gen-server/lib/HomeDBManager.ts#L3946) but no action will be taken on it. In our hosted service, we have that event hooked up to sendgrid, a service we use for sending templated emails. Something more general purpose and easier to set up for self-hosting is still a TODO.

helmut72 commented 2 years ago

Thank you for clarify! Now I was so brave to try it and great, this user can now collaborate. No mail sent :) Should we close this issue?

paulfitz commented 2 years ago

:) Glad it works for you. Sure, closing.

dumblob commented 2 years ago

I've heard some good references on the docker image https://github.com/docker-mailserver/docker-mailserver which might be one of the possible go-to solutions for self-hosted deployments of grist (might be of interest for you @paulfitz).

helmut72 commented 2 years ago

@dumblob Grist just need an option to configure any mailserver and don't need it's own mailserver.

dumblob commented 2 years ago

Sure, but in addition to that I understood there is no go-to solution for self-hosted deployments. Therefore I mentioned it :wink:.

helmut72 commented 2 years ago

A mailserver doesn't help. Grist need the code to send mails to a mailserver and not to be a full blown mailserver. Grist only need the mail client code, like Outlook or Thunderbird and not the code of a mail server, like Postfix or Exchange.

dumblob commented 2 years ago

Of course - that's what I meant with "in addition to that".

almereyda commented 2 years ago

To cite the comment https://github.com/gristlabs/grist-core/issues/146#issuecomment-1047232810 above, without repeating it, I would like to ask:

Is it possible to hook this event into a Webhook, and have mail sending taken care of by another party, say n8n?

This would allow for Grist to be able to send mail messages via a transactional API that is self-hosted, without having to imlement an SMTP MDA.

paulfitz commented 2 years ago

@almereyda that's a good idea. So for example Grist would hit some endpoint specified in an env variable, like GRIST_NOTIFICATION_WEBHOOK say, and pass along a json with all the event info? Then someone could hook that up to e.g. n8n to mail out whatever notifications they actually need.

almereyda commented 1 year ago

As n8n already has an official Grist node for interacting with the API

it could be interesting to explore how to add a Grist trigger node.

This could then in return also be used to receive events from Grist in n8n. I don't know about the internals of n8n Trigger Nodes, so I wouldn't know how to implement that myself.

Webhooks on the other end are already a first-class citizen over there, and could be used right away.

ben-pr-p commented 5 months ago

Is there a recommended way at the moment for having sharing notifications on self-managed Grist?

I don't need complex email notifications, just a simple invite notification when you are added to a team site or workspace.

I have a sendgrid account, but looks like adding the environment variable only does something when using the entreprise image.

almereyda commented 1 month ago

@paulfitz Would you like to reopen here?

https://support.getgrist.com/self-managed/#how-do-i-set-up-email-notifications suggests, that you are open ("yet") for SMTP notification transport. Here, we are also interested in the use case, esp. for an option for rich text diffs later down the road.

SMTP transport is also a dependency for #1086 to work for self-hosted installs.

To also continue the side-conversation around workarounds to sending email notifications, Webhooks support has landed last year (#76) and can be used to exfiltrate event data. It would be left to a curious person to show a first example for email notifications.

paulfitz commented 1 month ago

Happy to reopen @almereyda. I don't know of anyone currently working on this though.

almereyda commented 1 month ago

It seems it will be worth the effort for a community contribution, when #1086 will have been resolved.