Help needed with virtualmin and cloudflare emails

OS type and version Ubuntu 20.04.5 LTS
Virtualmin version 7.3-1

thank you for all your information and help. I’m having Webmin and Virtualmin(LEMP stack) installed on Ubuntu 20.04. Machine is VM on Hetzner Cloud.

FQDN is configured to use Cloudflare NS and the domain is added on Cloudflare as a site. Cloudflare Cloudflare DNS and SSL are configured as following :
Cloudflare SSL and TLS settings are as follows:

A domain name is added on Virtualmin and configured to use following:

DNS for domain is enabled and - Nginx with SSLvhost is working great. Virtualmin DNS options:

I have trouble with configuring outgoing emails, they are working internally. If i try to send email from to they are working nice sending and receiving.

When i try to send to gmail or any other mail i can’t send mails.

Postfix is running and i got this error message when i try to send email to any outside domain or service provider, they don’t end up in spam folder either.

Postifx error -

What is configured wrong? Is it DNS records? Let’s encrypt is working for fqdn, cloudflare proxy is turned off. Email reciving is working but I can’t send emails.

host -t MX

Other maybe usefull informations:

Should I turn DNS on Webmin and Virtualmin and use Cloudflare only? Please help, any kind pieces of information are most welcome, and if you need any log or piece of information please let me know.

I would like to know what am I doing wrong here :frowning:

Thanks in advance.

Turn your SSL/TLS on Cloudflare to Flexible instead of Full and try it again. If it works, then there’s something up with your certificate or its configuration.

@Gomez_Adams thanks for info.
Did not help when on flexible, all SSL certificates are Let’s Encrypt even hostname. R3 certificates across all server, and CF on DNS only.

@dimitrist it’s the first month so I’ll have to wait and open requests for ports to open.
I’ve managed to send mail over gmail smtp(Laravel 9).
But still emails from local to gmail are not working :frowning:

I’ve copied SPF and DMARC records over from Virtualmin to Cloudflare DNS records, MX as well.

Cloudflare DNS with TXT records from Webmin/Virtualmin

Virtualmin DNS records:

Email logs:

Still, emails are working locally but when I try to send them to Gmail or vice versa I got errors, they can’t be delivered either way.

thats outbound traffic being timeout, i don’t think cloudflare would effect that. do ping tests on the server to gmail. If ping ok. Then check if SMTP is open.
P.S. port 25 if blocked. That needs to be open.


U were right, I just thought I’ve misconfigured something, sorry.

I’ve managed to send emails via google SMTP and 587(Laravel 9 app).


Port 25 is blocked indeed, I will give it a week and a half and see if the ports are good then.

Thank you all for your help.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.