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

Arrow
Arrow
ArrowArrow
Join the Party
Open Government
Platform
Police Accountability
News
Events

Email Deliverability Solutions

Emails Showing up In Spam Folder

This past week I ran a number of email tests using analyze.email. 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 https://dkimcore.org/tools/. 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. 1523987017.njlp.org._domainkey). 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 dkimcore.org 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 https://dkimcore.org/c/keycheck. For your selector use the selected prefix, followed by a dot, followed by your domain name (e.g. 1523987017.njlp.org). 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
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
“Wanted” Ivan the Troll to Find Out if 3D Printed Guns Are a True Threat

As nefarious as people want 3D-printed guns to look, there is another side of the story entirely. What if everything yo [ ... ]

Latest NewsFull Story
2019 NJLP Convention Agenda

2019 NJLP Convention
March 23, 2019
Agenda 09:00 Call to order & quorum check [Chair] 09:05 Agenda review & appr [ ... ]

Latest NewsFull Story
Fragility of Socialism: A Case Study of Guatemala

On June 3, 2018, the communities surrounding Guatemala's Mount Fuego were devastated by the volcano's eruption. An estim [ ... ]

Letters to EditorFull Story