@techbasati
I’d definitely take a look at the guide that @hansen referenced. It’s a good starting point and will get you moving in the right direction.
When it comes to e-mail, setting up Postfix or Sendmail alone will not “just work” as expected, if your intent is to stay out of SPAM/Junk folders.
SPF, DKIM, DMARC, and PTR (Reverse DNS) are the main things you need to look at and setup if you want to stay out of SPAM/Junk folders. Without these, the vast majority of what you send will land in these folders, unless the e-mail address is whitelisted for every single recipient you send to.
That being said, managing a mail server can be a major pain. I’ve done it, I’ll most likely end up doing it again in the future, but I don’t like it. There’s simply so/too many factors and because of this, that’s why so many third-party solutions, such as SendGrid and Mailgun, have popped on to the scene.
If you’re wanting something simple, less complex, etc – running your own mail server won’t provide that. I’d recommend looking at SendGrid, MailGun, Google Apps (G Suite), etc. Many are free for a certain number of monthly mails, others are paid (specifically G Suite).
DigitalOcean will not resolve this for you, they are only the provider for droplets. If you don’t want your mail to be going to your spam, you need to think about alot of stuff. You are currently just using the mail command in your server. But if you want to setup a REAL mailserver, you need to think about
You can’t just setup a droplet and start mailing, otherwise we would all have our mailboxes full of spam. Thats why companies make spam filters ;)
If you don’t know where I am talking about, I suggest you start digging into documents or use a third party to send email.
Here digital ocean makes me upset, I know nothing is easy when we try to kick start but you should provide me solution, not problem which I would face. I will check out these stuffs
Postfix, dovecot
SPF, DMARC, DKIM, TLS, PRT, etc. etc.
Finally I get messages out of spam
a) created SPF: https://www.digitalocean.com/community/tutorials/how-to-create-a-spf-record-for-your-domain-with-google-apps.
b) Created DKIM: https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy.
Did I need to set DMARC, and PTR . If yes please tell me how to configure