RE: [dkim-milter-discuss] dkim_chunk() and CRLF

From: Murray S. Kucherawy <>
Date: Fri, 12 Mar 2010 08:41:59 -0800

> -----Original Message-----
> From: Stefan Schulze Frielinghaus []
> Sent: Friday, March 12, 2010 3:29 AM
> To:
> Subject: [dkim-milter-discuss] dkim_chunk() and CRLF
> Hi,
> I'm trying to feed dkim_chunk() with an email I receive from an
> external
> library. At the moment I always receive an DKIM_STAT_SYNTAX error.
> Having a deeper look inside of dkim_chunk it seems to me that it
> distinguishes between a \r and a \n. A quick search over the net broad
> to me in mind that there was some kind line break separation which the
> standard declared through \r and \n. Is this still true or do I miss
> something? I went through the whole email I received from that library
> and there was no \r at all, only \n's. If that violates the standard,
> then I would be happy to found the problem and I could try to deal with
> it. Otherwise any other ideas why I receive an DKIM_STAT_SYNTAX error.

Hi Stefan,

I'm the original author of dkim-milter. I've since left the company that sponsors that work, and they haven't added any new people to maintain it, so you probably won't get an answer on that list.

I've since resurrected the project under the name OpenDKIM, I hope you'll check us out over there, especially since there has been at least one bug fixed in dkim_chunk() since we started up the new project.

The dkim_chunk() interface does the work of splitting up a message into headers and body for you, and then calls dkim_header(), dkim_eoh() and dkim_body() for you as appropriate. Thus, the only time dkim_chunk() returns DKIM_STAT_SYNTAX is if one of those functions returned that.

You're right, dkim_chunk() relies on the input having end-of-line being marked by the string "\r\n", just like the rest of the library does. This is standard email practice, and is stated in the documentation for that function (see libopendkim/docs/dkim_chunk.html). Without that, it will end up passing the entire message as a single header to the rest of the library, which will obviously result in a syntax error. The library does have a flag feature called "FIXCRLF" that is intended to compensate for input that doesn't conform to the standard, but dkim_chunk() doesn't currently implement that feature.

Let me know if you have any more questions.

Received on Fri Mar 12 2010 - 16:42:09 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:19:46 PST