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
2020 Presidential Petitioning

Petitioning has ended for New Jersey. We have successfully placed Dr. Jo Jorgensen and Spike Cohen on the ballot! A big [ ... ]

Latest NewsFull Story
Regarding 'Grid-locking'

NOTICE There are rumors that some people are considering using the protest tactic known as "Grid-locking" to protest Go [ ... ]

Front Page ArticlesFull Story
Fear, Government, and Freedom
Fear, Government, and Freedom

Approaching the fear of a quantifiable threat while pursuing life, liberty and happiness.  COVID-19 is real and social [ ... ]

Latest NewsFull Story
Help With Homeschooling
Help With Homeschooling

New to Homeschooling? Libertarians are Here to Help! Given the difficulties associated with the Covid-19 Pandemic, New  [ ... ]

Latest NewsFull Story
March 3rd - On this Day in History
March 3rd - On this Day in History

On March 3rd, 1882 Charles Ponzi, the creator of our modern Social Security system was born. The Ponzi Scheme is now use [ ... ]

Latest NewsFull Story
2020 NJLP Convention Agenda

2020 NJLP Convention
March 21, 2020
Virtual Meeting
Proposed Agenda Note: We will be meeting using Zoom. Go to https://zo [ ... ]

Latest NewsFull Story