views:

427

answers:

3

It looks like there are some great libraries out there to do DomainKeys signing of emails on C#/.NET, but I'm having a really hard time finding the same kind of support for PHP. Maybe I'm not looking in the right place?

The only one I found is http://php-dkim.sourceforge.net/; it looks incredibly hacky and supports PHP4 only. Considering how popular PHP is, and how critical DomainKeys are for email classification as non-spam, I'd expect better tools; do you know of any? Any other tricks you'd recommend?

Extra info: I'm using an external SMTP provider because I need to send out thousands of emails per day.

A: 

You can also try the SquirrelMail plugin,

http://eder.us/projects/domainkeys/

ZZ Coder
+3  A: 

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(2)

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

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

This Guide for Fedora/dkim-milter/postfix (4) 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 (5).

Best of luck to you.

Sorry for the link issues, apparently I can only post 1 link until my reputation is up. please match up the (#) above with links below

link workaround: (2) old.openspf.org/webgenerated.html (3) whatismyipaddress.com/blacklist-check (4) allaboutlamp.com/2009/09/setup-dkim-for-postfix-in-fedora-using-dkim-milter/ (5) dkim.worxware.com/

jigglee
Useful info, but not for me, sorry. I'm using an external SMTP email provider and have no control over their code. I have to use them as i'm sending thousands of emails. The rest of the suggestions do not directly apply to my question.
Alex
@Alex: I was about to code my own DKIM implementation for PHP but I'm with jigglee: the MTA should handle it. Imagine that the MTA alters / reformats the email content, there is no way for PHP to know that à priori and that would make the private/public keys to fall apart, it would have the adverse effect.
Alix Axel
A: 

PHPMailer has some support for DKIM signing.

donis