grist-core icon indicating copy to clipboard operation
grist-core copied to clipboard

feature request: smtp settings for self hosted installation

Open helmut72 opened this issue 3 years ago • 15 comments

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.

helmut72 avatar Feb 21 '22 07:02 helmut72

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.

paulfitz avatar Feb 21 '22 21:02 paulfitz

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?

helmut72 avatar Feb 21 '22 21:02 helmut72

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

paulfitz avatar Feb 21 '22 21:02 paulfitz

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).

dumblob avatar Feb 22 '22 19:02 dumblob

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

helmut72 avatar Feb 22 '22 19:02 helmut72

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

dumblob avatar Feb 22 '22 19:02 dumblob

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.

helmut72 avatar Feb 22 '22 19:02 helmut72

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

dumblob avatar Feb 22 '22 22:02 dumblob

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.

almereyda avatar Aug 17 '22 16:08 almereyda

@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.

paulfitz avatar Aug 17 '22 16:08 paulfitz

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

  • https://docs.n8n.io/integrations/builtin/app-nodes/n8n-nodes-base.grist/

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

  • https://docs.n8n.io/integrations/builtin/trigger-nodes/

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.

  • https://docs.n8n.io/integrations/builtin/core-nodes/n8n-nodes-base.webhook/

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

almereyda avatar Apr 10 '23 17:04 almereyda

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.

ben-pr-p avatar Jun 06 '24 12:06 ben-pr-p

@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.

almereyda avatar Sep 27 '24 14:09 almereyda

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

paulfitz avatar Sep 27 '24 15:09 paulfitz

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

almereyda avatar Sep 27 '24 15:09 almereyda