polhallen said:
... use my server with Courier (mail server), Apache, SSH, but with a real domain
In general it is possible to have said services on your own server on a dynamic IP using a dynamic DNS service. Many domain and web-hosting providers offer this. For example some of my domains are hosted by strato.de, and I use their dynamic DNS service using
ddclient on my server at home for keeping the DNS records updated with the dynamic IP.
However, the main issue is, that the ISP who connects my home to the internet is blocking the most useful incoming ports 20, 21, 25, 80, 443, 587. Therefore, I have to run all services on non-common ports, and a mail server for receiving mails from the outside is not viable at all. The other services are to a certain extent useful on others than the standard port numbers, though.
So before doing anything else, you might want to check with your ISP whether they do blocking of incoming ports, and in case which ones are blocked.
In any case you don't want to setup an outgoing mail server, because most of your mails won't be accepted by other receiving mail servers because your mails would come from a dynamic IP. You want to setup your mail server to send all your mails first to a mail relay with a static IP and a well formed reverse DNS entry.