Question

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 https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-dkim-with-postfix-on-debian-wheezy.

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:

TXT	
example.com
v=spf1 +a +ip4:1.1.1.1 ~all
3600

This is my DKIM record:

TXT
mail._domainkey.example.com
"v=DKIM1; k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC5N3lnvvrYgPCRSoqn+awTpE+iGYcKBPpo8HHbcFfCIIV10Hwo4PhCoGZSaKVHOjDm4yefKXhQjM7iKzEPuBatE7O47hAx1CJpNuIdLxhILSbEmbMxJrJAG0HZVn8z6EAoOHZNaPHmK2h4UUrjOG8zA5BHfzJf7tGwI+K619fFUwIDAQAB"
3600

In my mail tester feedback I got the following result:

[SPF] Your server 1.1.1.1 is authorized to use www-data@example.com
[Sender ID] Your server 1.1.1.1 is authorized to use inquiry@example.com
Your message is not signed with DKIM
You do not have a DMARC record
Your server 1.1.1.1 is successfully associated with example.com

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 https://wordpress.org/plugins/wp-mail-smtp/ 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…

@richardp

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:

https://wordpress.org/plugins/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 https://gordan.jandreoski.me/how-to-configure-postfix-relay-to-office365-on-ubuntu-14-04/, but that failed miserable, so will above setup be similar?

Cheers