httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rian Hunter <r...@MIT.EDU>
Subject mod_smtpd design.
Date Fri, 01 Jul 2005 06:44:19 GMT

Currently there are two approaches we are looking at for mod_smtpd. We 
can use the existing request_rec structure, and store smtp specific data 
in a structure stucture in the r->request conf vector. With this we can 
reuse some of the existing core hooks that make sense (handler, 
create_request) while also adding some new ones for smtp (envelope, 
called after all necessary commands have been sent). The downside is 
that a lot of the request_rec members are extraneous for smtp.

The other approach is to use a custom smtp_request_rec structure for an 
smtp session. This has the advantage/disadvantage of defining new hooks 
only necessary for smtp, but the disadvantage is that currently in httpd 
2.x filters that alter content data require a valid request_rec. It 
would be possible to pass a bogus request_rec with the filters set to 
ap_add_*_filter*() (or ap_run_insert_filter() so we let reuse core's 
handle the Set(Out|In)putFilter directive), except that seems a little 
hackish to me.

Currently a session specific smtp data structure will have the fields:
(string) (he|eh)lo argument
(string) mail from argument
(string) rctp to argument

a module specific data structure wlil have the fields
(table) supported smtp extensions (could be extended by other modules 
with ap_run_post_config())
(bool) smtp enabled?
(string) server identifier (mod_smtpd by default)

Since filters are something of great importance to mod_smtpd, i'm 
leaning toward keeping request_rec, and storing session specific data in 
r->request_conf, although I am very open to doing away with request_rec 
completely and definining new hooks (which also means adding new handler 
directives, eg. SetSmtpHandler). Anyone have any thoughts and additional 

Here is a list of hooks i was thinking that mod_smtpd should call:

ap_hook_auth_checker     /* maybe this one after helo, mail from, rcpt
                             to but before data */
ap_hook_create_request   /* after the request_rec has been created */
ap_hook_fixups           /* right before calling handler */
ap_hook_handler          /* called to handle request or session */
ap_hook_insert_filter    /* right before calling handler */

either ap_hook_auth_checker or a new hook we'll define for smtp 
(tentatively called "envelope"). that's still up in the air. If we go 
with the discarding request_rec design, basically we'll still call these 
logical hooks.

Are there any complications I've overlooked? Any criticism or comments 
are very welcome!!

View raw message