On thing important when you have you own linux box to host a web server is the ability to send email as many services are relying on this.
Often mail server receiving these email will flag them as spam because of improper configuration. Here is how I have been able to overcome this issue:
- Make sure you have a domain or subdomain pointing to you server IP that you can use as a tool domain. In this example I will user server.idowebdesign.ca
- So I have a A record with server.idowebdesign.ca pointing to the server IP
- Now edit the file configuration /etc/postfix/main.cf
- Make sure the hostname file looks like this: myhostname = server.idowebdesign.ca
- Also make sure this line is like this: inet_protocols = ipv4 (this will ensure the postfix is only using ipv4 and ipv6 to send out the emails).
- Restart Postfix: /etc/init.d/postfix restart
- Now create a SPF record in you DNS to allow sending email from this IP. Create a TXT record and the content should be: v=spf1 ip4:xxx.xxx.xxx.xxx -all where xxx.xxx.xxx.xxx is your server IP address. The txt should be on server.idowebdesign.ca (the domain you have used in step 1).
Now you should be all set. You can test it by having the server send an email, on my side I use WordPress recover password to test it against google server. The mail should not go to spam anymore. Check the original version of the mail (in gmail, dropdown next to reply button > show original). This will help you to troubleshoot if the email still goes to spam.