When it comes to spam filters of free email service providers Gmail spam filters are most sane, Gmail will only block your mails or send them to spam folder if there is pattern of spam or broken configuration from your mail server.
Gmail will also provide specific error in mail marked as spam providing details as why your mail is marked as spam. Other ISP will not provide you this detail.
You have to check “Why is this message in Spam” message gmail display when you open mail from spam folder.
Here are various error messages
1) “It contains content that’s typically used in spam messages”
Well hard to argue here as your email content is simply too spammy and you need to audit your mail content. Its normal for newsletter to land in spam if too strong html is used.
2) “We’ve found that lots of messages from domain.com” as spam
This simply means your domain has been sending spam and you need to immediately check your mail server logs as gmail has basically greylisted your domain.
3) “This message may not have been sent by: somebody@domain.com”
If you are sending email to any user make sure your From address is valid, For example if sending mail from site somedomain.com its good practice to send mail specifying noreply@somedomain.com for example as sender than specifying some 3rd party domain or even hotmail or gmail address as sender which make no sense to receiving server.
If you want people to reply to specific email account then you can specify it as reply address but From address should always be valid.
4) “It’s similar to messages that were detected by our spam filters”
Now this is Ambiguous error message on which we can work on, it means other users have reported similar mail as spam or your email server IP is greylisted.
However in most cased this is because there is no DKIM or invalid DKIM record. You can check this by opening Full header in gmail ( More -> Show Original). Please check this screenshot as how to check Full Header of mail in gmail
Scan full headers and see if you can find
dkim=pass
If you cannot find dkim= in header then it means there is no DKIM record.
Now if there is error in DKIM setup for your domain you will see errors like
Authentication-Results: mx.google.com;
dkim=temperror (no key for signature)
Or
Authentication-Results: mx.google.com;
dkim=fail
Or
Authentication-Results: mx.google.com;
dkim=permerror
Please note task here is to get dkim=pass
Authentication-Results: mx.google.com;
dkim=pass header.i=@yourdomain.com;
All you need to do is delete existing DKIM record at your server and setup it fresh.
If using cPanel first simply delete DKIM record from cPanel -> Advanced DNS Zone manager and then setup it again using following command
/usr/local/cpanel/bin/dkim_keys_install cpanel_username
Its important to delete existing record before setting it up again.
Also check SPF record in mail header and it should also be spf=neutral or spf=pass
If its showing spf=fail then you need to correct SPF record as well as DKIM record.
Once DKIM and SPF are showing as pass in gmail header your mails should be landing in Inbox.