Wishes Granted

This page is a repository for WishList and ToDo entries that have been completed.

-- TavisRudd - 23 Feb 2002


Extension cascading - Added to the cvs in Dec. 2001

When dropping the extensions from filenames in requests the existing Webware will raise an exception if there are multiple files with different extensions for the requested basename. It should allow you to specify a list of extensions to cascade through and use the first one found. If you list .html before .py in your list of extensions and a request can map to 'file.html' or 'file.py', 'file.html' will be returned rather than raising an exception.

-- TavisRudd - 31 Oct 2001

This might be represented by a nested list, like ['.tmpl', ['.py', '.psp'], 'html'], which would mean that .py and .psp would be at the same level of precedence (and an error would occur if there was abiguity)... unfortunately this isn't backward-compatible, but I don't think it matters much here.

-- IanBicking - 06 Nov 2001


Email interface

It would be nice if the AppServer/servlets could respond to email in addition to HTTP requests. This would have to be done through adapters, because most email configurations are probably more complex than HTTP servers (though most situations will use the same very simple interface). Typically it would be with a small program that gets the entire text of the message dumped to it -- such a program would be very easy to write, but I'm not sure how to map that to a request (maybe XMLRPCServlet is analagous). I assume the adapter will take the target servlet as a command-line argument, as I don't see any natural mapping between emails and servlets. The servlet would not have any meaninful output. -- IanBicking - 04 Jan 2002

I thought a MailKit might be nice. You could have a Request object (similar to HTTPRequest, I suppose) which is fed by some kind of agent - it's possible to implement a program which scans a POP3 mailbox, for example, even though most mail handling applications seem to ignore this entry-level (and very useful) approach. The Response object would be passed on to some SMTP agent. -- PaulBoddie - 14 Jan 2002

More on this: one could implement something comparable to WebKit.cgi or an adapter like mod_webkit which connects to AppServer and feeds requests to them in almost the same way. These new adapters could even be part of an SMTP server (there's one available for Python). Perhaps there would need to be another connection point for these other adapters in AppServer, and applications implementing servlets and pages for e-mail would obviously need to be aware of the limitations of the medium. -- PaulBoddie - 21 Feb 2002

I've made this. I haven't been able to test it properly due to unrelated MTA configuration issues. It's based on WebKit.cgi, and connects to the AppServer very similarly to XML-RPC, except it passes an RFC822-formatted message (the email) instead of the XML input. This is sufficient, except for the fact that it pretends the post data is of type text/xml instead of message/rfc822 -- adding a small hook to Webware is all that's necessary to fix this. It runs from a pipe so, for example, you can set it up by putting something like "|/usr/local/Webware/WebKit_/WebKitEmail_.py /path/to/servlet" in your .forward file. -- IanBicking - 21 Feb 2002

I had a look to see what implementations of mail protocols in servers there are for Python and I found a few interesting packages and applications. There's a POP3/SMTP mail server called "shicks" which I'd never seen before, although that might be too heavyweight for a lightweight Webware interface (and it's GPL'd). What the extra component needs to support is SMTP reception and sending (as far as I can tell), but WebKit should, unlike with HTTP requests, allow the creation of new "mail" requests which can get out to this new component. Question: should incoming and outgoing mails be handled by a single component? (Of course, one could change WebKit to allow new HTTP requests to be created by applications, but this would be for client-side connectivity to other sites - another fascinating area to experiment with.) -- PaulBoddie - 22 Feb 2002

I feel most email systems will be heterogeneous, similar to web servers (mine is). So, an adapter-like interface is easiest for when you want to direct just a few emails to Webware (global redirecting is still easy). For sending emails, smtplib works well right now. Email isn't really a request-response protocol, and I don't think there's any reason to make it look like that. -- IanBicking - 22 Feb 2002