> I'll use POP3 as my example, although any other service (eg telnet, ssh, 
FTP, SMTP) are equally valid.
>
> Having apache run on a non-http port, say port 110 (POP3), could be 
handy.  You could even have POP3 running elsewhere and use the POP3 module:
>  o  to proxy POP3 requests inside a firewall, or
>  o  to proxy to a POP3 running on a non-standard port (eg 10110), or
>  o  to get POP3 mail from multiple accounts!
>     Imagine, a custom mod_perl POP3 server which grabs mail from all
>     your email boxes all over the net.
>
> There are two major stopping points from being able to do this today with 
Apache/mod_perl:
>
>  [1] POP3 clients do not send HTTP headers.  Is there already a
>      way in mod_perl to get a request before the HEADERS are parsed?
>
>  [2] POP3 clients have 'interactive' connections.  Is there a way in
>      apache/mod_perl to read/write more info from a socket without
>      dropping the connection?


The whole Apache request model doesn't map at all well into the POP3 model.
You just can't fit the POP3 dialog in the http request model, it's not just
the headers. The hook has to be at a lower level. You have a core engine 
that
handles the process/threading, listens and dispatches incoming connection.
This is where a new pop3 core code steps in. You need to define you own
abstraction for POP3 concepts. You won't have one request, but many. The 
phases
will be different. Once this is implemented and has appropriates hooks and 
a
nice API, you can start writing mod_perl_pop3 which embed the perl 
interpreter
and lets you write pop3 perl scripts.

Actually IIRC apache 2 already has a protocol-independant core with hooks
that can hand over a connection to a specific protocol handler. I don't 
know
however the extent of the support, e.g. for dispatching to modules.

> > Matt Sergeant <[EMAIL PROTECTED]> wrote:
> > >Would it be possible to have a generic server, like Apache, but not 
just
> > >for HTTP - something that could also serve up NNTP connections, FTP
> > >connections, etc. It seems to me at first look this should be 
possible.
> > >
> > >As I can see it there's a few key components to Apache:
> > >
> > >forking tcp/ip server
> > >file caching/sending
> > >header parsing
> > >logging

I'll add to this list:

configuration
module management
generic i/o

I'm not sure I see how header parsing is a generic thing. Seems to me
different protocols handle headers in different ways, at different times.


> > Not wacko. Although it may not be desirable, at least in the way you
> > envision. Say there's a bug in one of your HTTP mod_perl modules, do 
you
> > want to lose SMTP?

I'd want to dedicate one pool of processes to SMTP trafic, and another to
HTTP, since the resource requirements are different.

> You could have *two* apaches running, one on port 80 and another on port 
25 (SMTP).

Actually to run a useful SMTP server you pretty much have to use port 25 
:-)

Now, a mod_perl enabled SMTP server would be very cool. Forget canonical 
maps,
write a PerlAddyHandler!

--
Eric

Reply via email to