• 1 Post
  • 11 Comments
Joined 21 days ago
cake
Cake day: January 24th, 2026

help-circle






  • Usually, the important parts of the mail, such as subject, sender and contents are protected by DKIM authentication. Unfortunately this is usually not visible to the end-user, i.e. as in my case, where mails fail DKIM, but are still presented in my inbox.

    Mail servers and relays add headers to the mail as it goes, for example their own IPs to trace the mail, or authentication results if authentication happens at various endpoints.

    In the end, the mail as in the gmail postbox is the result of the original mail, and all these additions of the mail relays. In an ideal world only DKIM authenticated would be presented to the end-user, but the world of mail seems to be so broken, that many sending servers just do not apply DKIM/DMARC correctly, and thus many receivers accept broken mail.




  • Yes, I’ve seen one other header change: gmail seems to (again sometimes?) enforce Message-ID fields in the header, and may add or change it if it doesn’t match it’s internal requirements. Interestingly, I’ve seen both my mailserver getting “rejected because missing message-id” messages, and messages passing to the mailbox, but with a google-added Message-ID in the raw source.

    For my specific case of DKIM failures, I’ve not noticed other differences.

    If I take the specific raw source from gmail, i.e. after processing by google, re-add the quotes, and manually check the DKIM signature, the signature passes. With other words, the quotes are literally the only relevant change in my case.


  • Ah interesting, I’m sending from my own domain and IP with DMARC set up to quarantine.

    Yes, the mail server is accepting it because gmail accepts the mail if either SPF or DKIM passes (not AND). My observation is that google for some reason sometimes puts the mail into spam, and sometimes into the regular mailbox. In both cases the headers show dkim=fail and spf=pass and I have no idea why it’s not deterministic. I’ve also tested this with same/similar mail contents.

    Edit: To be honest, I also don’t think that mail from my domain should be “sometimes” in the regular mailbox, if DKIM fails and DMARC has adkim=quarantine.