I played around with this with EmailKit:
I plan sometime to work with it again, but I haven't done anything with
it for quite a while -- it might need a little bit of editing, since raw
access to the request has changed. Also it would ideally use the new
Someday I would like to make something similar to Debian's bug tracking
system, where an intermediary (Webware) intercepts and records email
related to particular tasks -- that was my initial goal with making
The adapter works as a standalone program that forwards to Webware and
is installed like you describe with ASK.py. For higher volume wkcgi
could be adapted fairly easily, since such an adapter would be very
similar to CGI. An SMTP server as with Twisted seems excessive -- real
environments are heterogeneous.
Ideally an email should produce something different from HTTPRequest. I
would propose that the adapter interface should be extended to use the
"format" key, using "email" or "rfc822" (?) or something -- it's
currently always set to "CGI". From there an EmailRequest could be
made. Which servlet would probably be controlled by a command-line
parameter to the adapter, so you'd get something like:
And perhaps EmailAdapter.py would take other (arbitrary) options that
would be passed on to the handler.
On Tue, 2003-01-14 at 10:11, Aaron Held wrote:
> Does anyone have any thoughts about a Mailhandler API?
> I recently needed to process some email and I took a look at Twisted
> Python and the James Mailserver (Java). They have some interesting
> ideas, but I am more comfortable w/ the Webware way of things.
> Where as Twisted tried to be the complete Protocol handler, Webware
> wants to be an app server that relies on Native adapters to handle the
> messy protocol details.
> James has excellent mail servlet structure that mimics the servlet
> architecture very well. You have a maillet that you can extent in much
> the same way you can extend a servlet.
> Currently I have a number of email robots that simply exist as pipe
> forwards in an alias or .forward file.
> My personal email has a forward file like:
> #forward to ASK spam filter
> which takes my email and sends to a script called ASK
> My first thought was to write a script using that takes the email and
> makes an XML-RCP call to webware, but that requires a lot of translation
> layers. A better idea would to to write an adapter that speaks to
> webware directly. Then you could write a 'pyMaillet' to handle that email.
> The adapter should also pass SERVER type variables that make sense to
> Anyway, since the email server in question is current MS Exchange, I
> wound up writing a python script that pulls the email directly from the
> server via IMAP. It will run as a taks under webkit, but that is not a
> clean a solution as something that runs when the email arrives.
> If anyone has any thoughts on this topic I would appreciate it. This is
> an untapped market for webware and I would not mind creating a proof of
> concept if other people see a need for it.
> This SF.NET email is sponsored by: FREE SSL Guide from Thawte
> are you planning your Web Server Security? Click here to get a FREE
> Thawte SSL guide and find the answers to all your SSL security issues.
> Webware-devel mailing list
Ian Bicking <ianb@...>