i have a domain with proper MX record.
As i said i have a LAMP Server > Linux Apache Mysql Php
Everything is on this sever. So Postifix is also on this server.
so why should i use my.maildomain.com instead of localhost ?
makes no sense for me, because nextcloud is running on the same server and could contact the mailsever via localhost.
Don’t forget SPF. Very important if it will communicate with other email systems. Some won’t talk to you without a PTR too.
As far as the domain part, you’ll have to explain in some detail or maybe show configs because I can’t tell what you’re getting at, i.e. are you trying to email user@localhost? Where are you entering localhost?
Yes that won’t work, because Postfix is no IMAP server. For that you would need something like Dovecot.
And no offense, but all this doesn’t sound like you’ve really looked into how email servers work and what the requirements are to run one. It is possible to run a fully fledeged mail server on the same server as Nextcloud is running, but there’s a lot more to it, than just installing Postfix and connecting Nextcloud Mail to localhost.
Also this doesn’t really have anything to do with Nextcloud. Nextcloud Mail, is just a regular email client that can connect to existing mail accounts om existing mail servers via SMTP and IMAP. Just like Thunderbird or any other desktop email client…