I'm using mailgun shared IP and I solved this problem recently. We only send transactional emails such as purchase notifications and delivery notifications, not a mailing list. I've checked all possible recommendation you can find online:
- SPF and DKIM
- fixed message HTML: html emails require proper html like any page, there's lots of boilerplates, I followed this one: https://github.com/seanpowell/Email-Boilerplate/blob/master/email.html
- added text version
- added the unsubscribe link at the bottom: unsubscribe mailgun will automatically replace with the proper link
- check if from_domain, signed_domain and reply_to_domain match
- check if you domain and ips are black listed, all ok
- don't waste time trying to contact yahoo and microsoft, they will say everything is fine. Mailgun already have the feedback loops implemented out of the box.
Everything was ok! There's several online services to test your messages. We were now 10/10 :) Great!!! The problem persisted :(
The solution was on the mailgun platform. Login, go to your domain, select the shared domain and hit delete it. If you're lucky they will assign a new shared IP. If not working try again later because it works. If this new IP is not flagged by the neighborhood your email will start delivering instantly.
Lesson learned: if you're doing everything by the book and still going to spam, the problem is always the IP. If you have the budget to buy your own, great! If not, try this work around and pray for good neighborhood.