I’ve now setup external SMTP server (using service from Resend with domain hcp.domain.ltd)
I’ve done setup using configure-server-smtp.sh. And I can get welcome emails.
But why some internal email (e.g. when i do sudo command from user account at web terminal, it will generate alert) is sending to [email protected] but not my admin account email address?
as well as out-of-the-box forward all messages addressed to root to the admin’s email address
So indeed HestiaCP have a function to forward/remap all [email protected] back to admin’s email? do this need to setup any email server or can be using SMTP service setup from configure-server-smtp.sh or Global email relay?
There seems no solution for some internal emails still send to root@hestiacp_domain.ltd
I am using another way round. If you do not setup email server, cannot find way to receive root emails, all email stucked at EXIM queue.
Your registered SMTP service need to create a domain same as your HCP domain (e.g. hcp.domain.ltd) also need to support Webhooks (I am using Resend, I will use Resend in the following steps)
setup email global relay point to your Resend
setup configure-server-smtp.sh also point to Resend
DO NOT setup a mail domain for your HCP domain (e.g. hcp.domain.ltd). This makes email being sent using global relay settings instead of Exim
One example is if I use SUDO command from web terminal, it will trigger an alert email sending from [email protected] to [email protected] and this will show up on your Resend console
at this moment, the email is undeliverable because you need to setup webhook to receive email and forward that back to your own email
For the rest, is about using API which support webhooks. I’ve learnt A LOT from here and setting up my own N8N to process the webhooks request and forward back to my own email address. (Because other cloud service are paid if using webhook node….Zapier, IFTTT, N8N cloud….etc)