XF 2.3 Emails won't send

Users have been reporting they aren't getting their OTP emails. After some DNS changes, the mail does send but will now always go to the spam folder. Using online email analyzers, it said that a DKIM record is invalid or not added at all, even though it is. I generated a DKIM in the email options of the Admin CP of XenForo and added it to our Cloudflare DNS records, and online DKIM checker tools say that "xenforo._domainkey" does return a valid DKIM, however when it comes to sending a test email, the DKIM signature is incorrect for some reason.

Here are the headers from the test email sent.
Code:
ARC-Authentication-Results: i=1; mx.google.com;
       dkim=neutral (body hash did not verify) header.i=@{XXXXX}.com header.s=xenforo header.b=fXj91kqT;
       spf=pass (google.com: domain of admin@{XXXXX}.com designates {IP ADDY} as permitted sender) smtp.mailfrom=admin@{XXXXX}.com;
       dmarc=pass (p=NONE sp=NONE dis=NONE) header.from={XXXXX}.com
1753246991867.webp
1753247021872.webp
1753247072539.webp
 
Last edited:
I am experiencing the same issue. The DKIM is set up correctly, but the email headers show 'dkim=neutral (body hash did not verify)'. The privateKey option value is set to false in the xf_option table. Not sure how to change it (and to what?). Any suggestions?
 
I am experiencing the same issue. The DKIM is set up correctly, but the email headers show 'dkim=neutral (body hash did not verify)'. The privateKey option value is set to false in the xf_option table. Not sure how to change it (and to what?). Any suggestions?
I'm leaning towards calling this a bug, but I bet it's not very visible to most people who had this set successfully prior to an upgrade. The way I understand this function is that it's supposed to set the private key for you once you set it through the ACP email settings. All you should have to do is enable DKIM in XF, setup the relative DNS records and that should be it.

@Kirby I saw you report DKIM issues in the past, do you have a current setup to [help] validate what seems to be going on here?
 
We don't use XenForo DKIM as that is somewhat inflexible (see my bug reports) and was insanely slow (in 2.2 at least).

Looking at the code it seems to me that DKIM signing is completely broken in XF 2.3 due to changes how email sending is implemented.

I'd recommend to setup DKIM signing at MTA level if possible and only use XenForo as last resort, the attached patch IMHO should fix DKIM signing in XenForo 2.3
 

Attachments

We don't use XenForo DKIM as that is somewhat inflexible (see my bug reports) and was insanely slow (in 2.2 at least).

Looking at the code it seems to me that DKIM signing is completely broken in XF 2.3 due to changes how email sending is implemented.

I'd recommend to setup DKIM signing at MTA level if possible and only use XenForo as last resort, the attached patch IMHO should fix DKIM signing in XenForo 2.3
Thank you! These changes solved the issue.
 
Back
Top Bottom