Julien Julien - 1 year ago 129
Linux Question

DKIM : Signature header exists but is not valid

I have configured Postfix with SPF and DKIM but all emails are marked as spam.

Here is my domain.db (I use bind9) :

mail._domainkey IN TXT ( "v=DKIM1; k=rsa; p=ABCD" )

I verify with :

host -t TXT mail._domainkey.domain.com

I receive (OK) :

mail._domainkey.domain.com descriptive text "v=DKIM1\; k=rsa\; " "p=ABCD"

I've checked also what could be the problem on email-tester.com, and I get 10/10, DKIM seems also correctly installed.

But when I check the content of an email, I see :

* -0.0 NO_RELAYS Informational: message was not relayed via SMTP
* -0.0 NO_RECEIVED Informational: message has no Received headers
* 0.0 T_DKIM_INVALID DKIM-Signature header exists but is not valid

X-Spam-Status: No, score=0.0 required=5.0 tests=NO_RECEIVED,NO_RELAYS,
T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.0

Any idea ?

----- UPDATE -------

After adding in master.cf :

-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_milters

Here is the new email content :

dkim:pass (now there is only one: OK)
* -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP

X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=ham
autolearn_force=no version=3.4.0

which seems better, but the email is still marked as spam, grrr

Answer Source

Here's what's going on with your SPF record.

Go to this link and change the DNS Server to `Google Public DNS (


The results of your SPF will be v=spf a mx ip4: ~all

Now change it to DNS Advantage (

The results of your SPF will be v=spf1 a mx ip4: ~all

Notice the difference v=spf vs v=spf1

So your DNS hasn't propagated yet and depending on how the receiving email server looks up your DNS Records you're running into issues. Wait 24 hours and if you're still having issues, reply back.