New Jersey Libertarian Party

The Party of Principle

Image is not available
Image is not available

Open Government Advocacy Project

NJLP Platform

Police Accountability Project

Image is not available

Upcoming Events

Join the Party
Open Government
Police Accountability

Email Deliverability Solutions

Emails Showing up In Spam Folder

This past week I ran a number of email tests using This website will analyze an email for the general "spamminess" of the email based on your server settings and the email content. My initial tests scored an awful 2.3 out of 10. After making several changes to the content and some server settings I have increased this to a 7.3 out of 10.

Email Content Problems

The report complained about two main content problems.

  • The email was classified based on the content as "BODY: Freedom of a financial nature." This dropped the score a few points. Being a fundraising letter for a libertarian candidate, I'm not sure what I can do about this. I left the text of the email the same.
  • The email used a message template and included links and embedded images. The email analyzer complained that the links and images contained a mixture of http and https references. I changed them all to use https.

Email Server Problems

It goes without saying that an essential part of successful email lists is a properly configured mail server. Key to having good deliverability from a server includes properly configured DNS settings. These include:

Most of these are fairly straightforward to set up. They can be tested by various testing sites. Looking at your message header of an email sent from your server will also tell you something. My email had most of this correct. But I need to tweak the DMARC record and fix the DKIM record.

I had a hard time getting DKIM working. My server uses cpanel/WHM to serve up each clients websites with the New Jersey Libertarian Party and  relevant websites being one of those clients. It seems that using cpanel “Authentication” page one is able to enable DKIM. It generates a DKIM record with a selector of ‘default’ and a private and public key pair. However, using a dns tester would fail with the selector of default. I thought I would solve this by duplicating the DKIM TXT record in the master dns editor (using my cloud server manager website) for the njlp zone. However doing this also resulted in a failing DKIM test.

I found that I was able to insert other DKIM records into the cloud dns editor and it would verify perfectly. It seems as if something with cpanel/WHM is overriding the record with a faulty record or cpanel is producing a faulty public key.

Steps I took to solve include:

  • In cpanel for your domains account choose “Authentication.” Enable DKIM. Ignore the generated TXT record displayed. We are going to override it.
  • Using whatever DKIM generator software you want generate a DKIM core key (public key, private key, and DKIM record). I used the generator at You will use this information below.
  • Edit /var/cpanel/domain_keys/private/$domainName (use your domain name, the file should already exist). Replace the contents with the private key generated
  • Edit /var/cpanel/domain_keys/public/$domainName (using your domain name) . Replace the contents with the public key generated.
  • Updated the cloud dns records for the domain’s zone. Add a TXT key.
    • For the host section use a prefix string followed by a dot (.) followed by your full domain name, followed by ._domainkey. (I used a random number for the prefix. e.g. When you save it the page will add the .$domainName to the end. (NOTE we are not using the selector suggested by the generator. The same prefix should be used for all sites using DKIM on the server. Whatever you choose, remember your prefix, this prefix will be needed below).
    • For the key use the value generated above in the bind 9 zone file section. Enter just the parts between the parenthesis. It should start with v=DKIM1; … Note that adds quotes spaces and carriage returns to the p key. These can be removed. You can leave off the beginning and ending quotes as well. (the cloud server will put these back in anyway).
    • After this is saved you can test the key at For your selector use the selected prefix, followed by a dot, followed by your domain name (e.g. Enter your domain name and press check. You should see “This is a valid DKIM record".

At this point we are almost there. The problem is that the email client will be trying to use default as the selector. We need to override this. Edit /etc/exim.conf. Find the line:

dkim_selector = default

Change it to say.

prefix.${dkim_domain} (e.g. 1523987017.${dkim_domain} )

where prefix is the same prefix you used in generating the keys. This will generate the selector you want for all of your domains! (NOTE: THIS STEP MAY GET UNDONE BY SERVER UPGRADES!)

This should be it! Test by sending an email from the domain to an account you own. View the messages source. You should see “dkim=pass (signature was verified)' in the header of the email.

Other Notes

A good place to test your domain is the MX Toolbox website. It won't give you a full dkim test and it does report some false positive failures.

Pin It
Hamilton settles strip search lawsuit for $425K, woman alleged excessive police force

HAMILTON — Township cops historically removed bras and subjected female prisoners to improper strip searches until a w [ ... ]

Police Accountability ProjectFull Story
Cops don disguises, trash cars of man who filed complaint against them, prosecutor says

Two Asbury Park police officers donned disguises to exact revenge on a citizen who filed a complaint against them by sla [ ... ]

Police Accountability ProjectFull Story
Politicians Don't Really Support Bill of Rights

Published 7/26/2019, West Milford Messenger Donald Trump's latest comments directed at congresswomen he doesn't like (" [ ... ]

Letters to EditorFull Story
Desde la Plataforma del Partido Libertario de NJ

15 Inmigración
Tema: Sostenemos que los derechos humanos no deben ser negados o abreviados en función de la nacional [ ... ]

Party Standards and RulesFull Story
"Freedom" Means Being Free To Choose

I have to chuckle to myself when I see all the pro-choice people getting upset over some of the recent abortion restri [ ... ]

Letters to EditorFull Story
The Immigration-Bigotry-War Nexus

America’s endless Middle Eastern wars have become politically sustainable as a result of millions of dollars in donati [ ... ]

Latest NewsFull Story