DKIM/Domain key signing

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
gmbzcode
Forum Newbie
Posts: 4
Joined: Wed Apr 23, 2008 11:11 am

DKIM/Domain key signing

Post by gmbzcode »

I did a little more hunting around and I think I've found what I need to a DKIM plugin(ok, to be perfectly honest, I don't give a dang about DKIM but it is a means to a more important end, Goodmail signing).

Looking at it, in the presend point in time, it seems I need the following functions:
From Class Swift_Message_Headers I can use the "build" method should give me the full formatted list of headers.
From Class Swift_Message_Mime do I use build or getData to get the entire contents of the body?

Than taking those two pieces of information, the proper RFC formatted file can be built and a signature generated. Than to set the signature(assuming DKIM/Goodmail/Domain Key) I simply need to insert it into the raw header information and use the very dangerous setHeaders function(adding a signature to the body of the text is much much much easier).

All in all, it looks like Swiftmail simplifies everything emensely(of course, this means modifying my target application to use swiftmail instead of phpmail, but since the functions it uses are simple that should not be a big deal)

Can anyone see any problems with the above? Other than that I'm playing with fire with that setHeaders function.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Re: DKIM/Domain key signing

Post by Chris Corbyn »

DKIM is coming in version 4 (but only in the paid version). Domain Keys and PKCS are also being included.
gmbzcode
Forum Newbie
Posts: 4
Joined: Wed Apr 23, 2008 11:11 am

Re: DKIM/Domain key signing

Post by gmbzcode »

Chris Corbyn wrote:DKIM is coming in version 4 (but only in the paid version). Domain Keys and PKCS are also being included.
For me, dkim/domain key is a stepping stone, so a PHP implementation doesn't accomplish my own goals.

I want to add a specific signing function to PHPlist. PHPlist uses PHPmailer which has very little in the way of advanced formatting options. Swiftmail has a better set of options, and since the PHPmail functions being used are on the trivial side, I think it should be easy to add a wrapper for PHPlist to allow a choice of swiftmail or phpmail(at least, that is easier than hacking phpmailer to add a sign function).

Than with swiftmail, if those functions do what I think they do, I can easily add in the domain key/dkim signatures(though for my purposes, it won't be a pure PHP implementation, instead depending on either python or perl to do the actual signing). Not ideal for everyone - a pure PHP solution would be best - but since my goal is to do a different sign function using a precompiled, commercial java application - it will be 'good enough'
Post Reply