I have currently a SMTP server (MTA) which handles outgoing mails from my domain. The server is DKIM & DomainKeys signing every authorized outgoing mail. Have tried with both postfix and Exim4, and have used dkimproxy, dk-filter/opendkim milter and the builtin dkim signing capacity of Exim4. They all have the same issue.
The problem is that different MUA's causes DKIM/DK validation to fail. When signing is implemented in the MTA, it shouldn't matter which MUA (Windows Live Mail, K-9 Mail, Thunderbird, Outlook etc) which is composing the email.
But it does, mail sent fron K9mail randomly fail DK validation, mail from WLM randomly fail DKIM validation, and mail sent from some other MUAs pass validations without problem. I think it has with line terminators to do (CRLF vs LF) and whitespace characters.
What I need is some component, that can be inserted as a milter into Postfix, or which is a perl module, which I can use to code a exim filter component, which "Scrubs" mails before sending it through signing.
Basically, it needs to pick out relevant data (From, To, Subject, Body, Content-Type, Boundary, Content-length, Attachments) and then rebuild the MIME data from ground up. Of course, it will scrap eventuel headers that the UA is adding, like X-mailer and such. Also, it needs to "scrub" eventual data it picks, so it does not contain anything that could make DKIM/DK fail.