Setting up DKIM Keys for CPanel Server in DNSMadeEasy

I am in the middle of a server migration and am working on DKIM keys for the domains on the affected server. I ran into an issue where the DKIM key data I was getting from CPanel wasn’t working when trying to use it in a txt field DNS record on DNSMadeEasy. I contacted their tech support and figured I’d post the solution here since I couldn’t find it elsewhere and since their documentation on the matter is so sparse.

The key info I was getting from DNSMadeEasy was:

"v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7jLS6S0MF4kJFyJOyE4Tm/Dv583oUGkUjbBa9CXWLrP4IYoamSrTqBiOQuXsbKw0yCObgDrJ844hH+yIFlTkw0FlKx/B706fEGPr7DL8L6mdicqZX1fbVqLs7GsX9OE0FOm1rUsr/eHQPug4F2JQ5yNDtjK0Jt07pYEpf6wWxY0HMNtq4oKwU3MBwgfsVx9Xs" xdDYMvs0vtVR2WQD1LAxgL20hWOPtZZ6QwhZhBFpHOuiN4WACSnGDtZhHE6Mxwy642eImQtsFjnJrIe1t0HT/dP2r5B7ptkk8ZgLbH8eiI2VY7GIV7g58sJTL86xvkYLrMXcWjow2L2Ho+MKivmawIDAQAB\;

Upon trying to put this into a txt field entry on DNSMadeEasy I would receive the following error:

Value contains mismatched quotes. All beginning quotes must have a corresponding terminating quote.

After fiddling with the quotes to make sure there were matched pairs, I would get this error:

Contiguous strings may not be longer than 255 characters

I contacted support and they informed me that by the standard, txt fields can’t have continuous strings longer than 255 characters, but can contain multiple strings. By the DKIM standard, any strings found are concatenated before being interpreted.

I broke the string up with double quotes into lengths of less than 255 in a text editor and made sure there were good matching pairs. I also removed the slash and semicolon at the end, as those don’t appear to have been necessary or helpful.

In the end I wound up with a txt record called default._domainkey.[domain] containing:

"v=DKIM1; k=rsa;""p=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA7jLS6S0MF4kJFyJOyE4Tm/Dv583oUGkUjbBa9CXWLrP4IYoamSrTqBiOQuXsbKw0yCObgDrJ844hH+yIFlTkw0FlKx/B706fEGPr7DL8L6mdicqZX1fbVqLs7GsX9OE0FOm1rUsr/eHQPug4""F2JQ5yNDtjK0Jt07pYEpf6wWxY0HMNtq4oKwU3MBwgfsVx9XsxdDYMvs0vtVR2WQD1LAxgL20hWOPtZZ6QwhZhBFpHOuiN4WACSnGDtZhHE6Mxwy642eImQtsFjnJrIe1t0HT/dP2r5B7ptkk8ZgLbH8eiI2VY7GIV7g58sJTL86xvkYLrMXcWjow2L2Ho+MKivmawIDAQAB"

It appears to work.

Quantity in cart for donations on shopify

I recently had a need to set up donation functionality on a Shopify web store.  Shopify provides a great method for adding donations to the shopping cart, but I found one aspect of functionality lacking.

Because the donations are implemented as an arbitrary number of a 1 cent donation item added to the shopping cart, if the user gets back to a page where the number of items in the shopping cart is displayed (like in a widget in the header), the number shown will be the number of items in the cart, plus the number of cents being donated.  Our desired behavior was to have a donation represented in this total as a single item, regardless of the amount.

Continue reading “Quantity in cart for donations on shopify”

Protecting Email Addresses From SPAM Harvesters With a CAPTCHA

If you manage any websites, you should be aware of the risk of publishing an email address publicly.  SPAM bots spider the web looking for these email addresses, adding them to lists that are sold and used to inundate you with glorious offers of organ enlargement and cheap watches.  Today I encountered the most robust solution that I’ve yet to see.

Continue reading “Protecting Email Addresses From SPAM Harvesters With a CAPTCHA”