I found it much easier to start by using a store-and-forward service to receive email and a relay service to deliver mail. A store and forward service will accept delivery of your incoming mail, do the necessary spam filtering and blacklisting, and then deliver messages to your mail system. The relay service will accept deliver of your outgoing mail, do any necessary validation, and see it to it's final destination.
Running a mail system involves a lot of moving parts, each of them requiring study and practice to competently operate. It can be difficult to deal with every piece all at once if you're just starting. The store and forward and relay services let me build out mail infrastructure without having to expose it directly to the internet, which let me deal with deployment in a much more controlled manner.
Why do you want to run your own mail server? It's hard to avoid potential pitfalls without knowing what you need to accomplish.