Mail server over Cloudflare tunnel?

Is it possible to host a mail server over a Cloudflare tunnel? If so, how would you set up the MX record for the mail server? It seems like a tunnel can only be accessed via a CNAME record, while a mail server’s MX record must point to an A record.

Great question. I did make me re-assess how tunnels work. And “tunnel” is the key word. When you set up a Cloudflare tunnel, remember that a :orange: proxied hostname defaults to HTTP/S, unless it’s a Spectrum hostname.

But in the example of SSH, that hostname is more the midpoint of the tunnel. You have cloudflared running on your server with the other end at the Cloudflare edge. But the other end of the tunnel actually resides on the user’s device. For me to SSH through the tunnel, I need to enter through cloudflared on my device.

I think the exception is for someone using WARP, which I believe acts like the local end of a tunnel.

At least I think that’s how it works. It just sees to me that unless it’s HTTP/S listening on Cloudflare’s usual ports, it’s listening for tunnel traffic on Port 7844.

1 Like