Setting up DomainKeys/DKIM in a PHP-based SMTP client [closed]

I’d recommend DKIM support at the MTA level so all your server generated email for a given domain is signed by default. (unless you have a really good reason to not sign all server generated email for a domain).

The best starting point in my googling to get DKIM setup on LAMP with dkim-milter and sendmail (on CentOS 5.2 in my case) was Jeff Atwood’s post about sending emails through code.

I would agree with him that the first 2 things you should address are reverse PTR record and DKIM signing.

Also very important:

  1. IP address of the box to send email not already being blacklisted.
  2. make sure [email protected] is a valid email box
  3. if your server generated email needs to appear to come from somewhere else (like a contact form needing to come from name/email provided in a form) follow these guidelines for email headers.

Here is the email ip address blacklist checker that I used.

Those 5 things will solve perhaps 95% of your email deliverability issues.

This Guide for Fedora/dkim-milter/postfix is also very good.

The PHP mail library I use for my app is PHPMailer 5.1 which has DKIM support (and is PHP 5 only), but after doing the research, I decided implementing at the sendmail level was a better solution. As you can see, even the author of PHPMailer 5.1 does not suggest DKIM at the PHP mail library level is the best solution http://dkim.worxware.com/.

Best of luck to you.

Leave a Comment