When I last looked into setting up my own email server, I read that your messages ending up in the spam folder was almost inevitable if the receiver is using a major host (Gmail, iCloud etc.) Is that still an issue?
I run my own mail server and have never experienced such issues. The important thing is that your mail server is not an open relay and you set up DKIM and SPF. Oh, and never run a mail server with an ip originating in a residential area, you'll get blacklisted almost instantly by virtually any mail provider.
So prereqs - 1) Valid reverse DNS on your sending IP. Preferably with a hostname that is also forward resolvable. 2) SPF Records 3) DKIM