immich icon indicating copy to clipboard operation
immich copied to clipboard

feat(server): email notifications

Open hitech95 opened this issue 1 year ago • 4 comments

  • SMTP transport is validated when SMTP settings are changed.
  • SMTP settings available in the WEB-UI
  • React-Mail template engine. It has built in components to provide modern web to "old" table based layout common in emails and text/plain email.
  • It is possible to view the rendered templates in real-time by running npm run email:dev in the server directory. This just ned the dependencies to be installed and does not require the full server to be running.
  • This can also be integrated with tailwind and generate email templates from already available classes.
  • Simple notification triggered when an user is created from the POST request to /user endpoint.
  • Option to skip sending welcome email when creating a new user

Known issues:

  • To generate server side URLs it is required to have the Server url configured. There is no handler right now if this fails the job also does.
Screenshots

Admin settings image

Create user form image

Welcome email template image

hitech95 avatar Apr 02 '24 00:04 hitech95

The library we're using will automatically upgrade to smtps if the mail server indicates it support the STARTTLS extension.

https://www.nodemailer.com/smtp/#tls-options

jrasm91 avatar May 01 '24 00:05 jrasm91

automatically upgrade to smtps

This feels prone to breakage or MITM attacks. Is there a way to enforce it, something like a toggle to reject plaintext connections or such?

bo0tzz avatar May 01 '24 08:05 bo0tzz

automatically upgrade to smtps

This feels prone to breakage or MITM attacks. Is there a way to enforce it, something like a toggle to reject plaintext connections or such?

Yes there is. So maybe enable that by default and have a toggle that optionally allows for insecure connections?

danieldietzler avatar May 01 '24 09:05 danieldietzler

FWIW it seems nextcloud does the same thing, there option is None/STARTTLS, so presumably they also auto upgrade

zackpollard avatar May 01 '24 09:05 zackpollard

I would be happy if we could add documentation to this. I hope to have some time to document this, can you put your name on Discord for me in case I have questions?

aviv926 avatar May 02 '24 16:05 aviv926