Scotisle
Ah, since you mention cloudpanel…
Cloudpanel installs ufw rules (which is the default firewall shipped with Ubuntu), and it only opens ports you can see in the admin UI.
You will need to open ICMP to allow the ping checks to work. You can check your firewall rules status with ‘ufw status’.
Hosting a webserver and mailcow on the same server is not the best practice and it would make sense if you could spin up another VM to run your mailcow setup in without the Cloudpanel firewall/nginx/postfix etc impacting your mailcow instance.
Like @esackbauer mentioned, setting up a mail server is a lot of work let alone maintaining and managing it to run without issues.
If it’s an incoming email with a custom domain required, then you could simply use cloudflare’s email routing feature, along with using their DNS services for your domain, to create customized email addresses for receiving emails.
You will still need an email provider where these emails will be routed to, and you cannot send emails with this custom email address.
https://developers.cloudflare.com/email-routing/get-started/
Alternatively, if its an academic exercise to learn to setup a mailserver, you can still go ahead with mailcow, but please try to set it up on a different server if possible, if not it will be a lot of mangling with the firewall rules.