TracecatHQ / tracecat

The open source Tines / Splunk SOAR alternative.
https://tracecat.com
GNU Affero General Public License v3.0
2.34k stars 159 forks source link

feat(engine): Add SMTP support to core mail action #259

Closed mattdurant closed 1 month ago

mattdurant commented 1 month ago

Description

This adds support for SMTP to the core actions by implementing a core.send_email_smtp action that is not reliant on Resend for sending in on-prem or non-AWS environments.

Configuration for SMTP settings is done via environment variables, so the default docker-compose.yml file was updated to pass those to the worker container. .env.example was also updated to include placeholders for the new variables for new installs.

Related Tickets & Documents

Fixes #136

Screenshots/Recordings

No new visual content, only added to icons.tsx so that the new action has the same built-in send icon as the original send_email function

Steps to QA

Nothing special, build and deploy, use the new action in a workflow. I used a live SMTP server to test on my end.

[optional] What gif best describes this PR?

topher-lo commented 1 month ago

@daryllimyt thoughts on making SMTP the core email action and moving resend to integrations?

daryllimyt commented 1 month ago

Thanks for taking this on @mattdurant! This is a great idea, let's get in for the 0.4.0 release

mattdurant commented 1 month ago

@daryllimyt @topher-lo do you want me to refactor and move the resend piece to a new integration and out of core, or did you want to handle that?

daryllimyt commented 1 month ago

Yes, it would be great if you could add those changes too - thanks!

topher-lo commented 1 month ago

@mattdurant looks like you'll have to setup pre-commit to pass our linting checks:

cd tracecat
pip install pre-commit
pre-commit install
pre-commit run --files tracecat/actions/core/email.py

Reference: https://pre-commit.com/

mattdurant commented 1 month ago

@topher-lo thanks for that, finished splitting resend out into a new namespace and it passed lint checks on my side