On Aug 15, 2005, at 10:22 AM, Joe Schaefer wrote:

"Jem Berkes" <[EMAIL PROTECTED]> writes:


Well there's also another problem. RFC 2821 (SMTP) doesn't define a
particular message format for SMTP (in wide use there the RFC 822 and MIME message formats). I don't think that mod_smtpd should assume a RFC 822 or MIME message format since its strictly a SMTP module, that's why


I agree with this


Now I'm confused; 2821 S-2.3.1 defines "SMTP content" as headers + body.
What am I overlooking?

2821 s-2.3.1 says:

If the content conforms to other
contemporary standards, the headers form a collection of field/value
pairs structured as in the message format specification [32]; the
body, if structured, is defined according to MIME [12].

Personally I interpret this to mean that the content may not conform to "other contemporary standards" although I do doubt the existence of non-RFC 2822 header formats.

I still think header parsing should be in another module.  Of course
this module is free to register itself as an mod_smtpd filter and do what it needs to do, but it shouldn't be part of the main mod_smtpd.


If you put in into a separate module, that means there will be no hooks which can expect the headers to be in r->headers_in. So every hook that needs them will need to parse it themselves, which seems absolutely redundant.

Furthermore it is a requirement (MUST) for a 2821 compliant server
to implement loop detection. That means at least one hook will *always*
care about the Received: headers, for every smtp transaction.  Why you
wouldn't want to provide an API for hook authors to use for inspecting
headers, seems like a very spartan choice, which IMO is counter to the
spirit of httpd.

Well not exactly. A module that parses headers can register itself as an input_filter for mod_smtpd. It can parse the headers and the headers can be accessed by a get_smtpd_headers(request_rec*) function or similar exported by the parsing module, and modules that rely on this module will know about that API. This module can even be included with the default mod_smptd package. Do you agree that this is possible?

The module that implements loop detection could rely on that module and also be included with the defautl mod_smtpd package.

Either way, lacking header parsing in mod_smtpd is being impractically pedant since probably 99% of SMTP transfers involve messages in the RFC 2822/MIME formats. Although I think that maybe there will be a plugin that wants data from the DATA command verbatim. I still feel this needs some thought.
-rian

Reply via email to