As the title says, I am contemplating setting up my own mail server at home. For fun and to learn how it works.

But, how safe is it? How credible is it that this could get hacked or compromised?

For those who host their own mail server, what have your experiences been with security?

Thanks