How can I get my DKIM identified?

I’m struggling to prevent my emails from vanishing or ending up in the email spam folder, and it looks like it is my DKIM record that is not identified correctly, so is there anyone who knows how to set up the DNS records correctly for this?

I followed this tutorial

I’m using an Ubuntu 16.04 droplet with WordPress and Postfix, and all email is hosted at Office 365, except a few emails which are posted via a web form on the website, and that’s where this issue comes into the picture.

This is my authentication report:

Summary of Results
SPF check:          softfail
DomainKeys check:   neutral
DKIM check:         neutral
SpamAssassin check: ham

This is my SPF record:

v=spf1 +a +ip4: ~all

This is my DKIM record:


In my mail tester feedback I got the following result:

[SPF] Your server is authorized to use
[Sender ID] Your server is authorized to use
Your message is not signed with DKIM
You do not have a DMARC record
Your server is successfully associated with

Please note that it’s only emails from a web form on the website that ends up in a spam folder, and all emails sent via the website uses Postfix and a PHP mail() function.

I’m not sure I can set a MX record, because last time I tried the Office 365 stop working, so any other advice on how to correct this is appreciated.

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

I’ve just installed and tried the plugin, but it was never used for sending the email, and I’m not sure what change to make, for it to work either.

I however, noticed that the password for this SMTP service in this plugin was written in clear and readable text in the database, so I’m not sure if this plugin is that secure to install :)

Well, I’ll dig a bit more…


It can be a bit of a headache, though thankfully there are solutions that allow you to work around the need to have and manage your own mail server.

The libraries I linked to are standard PHP libraries, so they don’t need to be physically installed. If you already have PHP working on your Droplet, you’d need to ensure that you’re using an autoloader to handle loading the class files when they are called – either your own, or use Composer.

That being said, since you’re using WordPress, you do have a slightly better option, and that would be to use a plugin. The one I’d recommend installing and using would be WP Mail SMTP:

When configuring the plugin, choose SMTP (not PHP’s mail()) function and then provide your SMTP details. As long as your Office 365 plan allows you to connect from an external server using your login details, you would simply provide those details to the plugin.

If Office 365 does not work, then you would need to sign up for one of the services I mentioned. For the purpose of this plugin, I’d probably go with SendGrid.

Thanks for a great answer - it’s a real headache.

I’m not familiar with anything mentioned above, but the PHPMailer or Swiftmailer looks promising, so do you happens know if there’s any tutorial on how to install any of those libraries on my DigitalOcean droplet?

Is there a requirement to signup for a third-party service to make this work, or can I simply use predefined Office 365 email with credentials to send all emails, or how will it work with my Office 365 hosting?

I tried to follow this tutorial, but that failed miserable, so will above setup be similar?