Forum OpenACS Q&A: non-java webmail module

Collapse
Posted by good bye on
I would like to implement a webmail module that does not rely upon
nsjava, nstomcat, or any java interpreter at all. This isn't to step
on anyone developing the java version's toes, I just want to see what
I come up with.

I am thinking of something that simply deals with qmail maildirs. My
current inclination is to hack apart one of the existing qmail-webmail
interfaces (all cgi-bin scripts; see http://www.qmail.org/top.html for
a list) and replicate the functionality with AOLserver TCL. Before I
get too much further, I was wondering if anyone has done anything like
this already. Code examples or architecture ideas would be very cool.
Post them here, or email me directly. When I have something cobbled
together, I'll post an announcement here.

Collapse
Posted by Li-fan Chen on
Create a AOLserver DB interface which wrappers around pooling POP3/SMTP/IMAP clients behind the scene using the AOLserver C API or find a IMAP client api/library for Tcl deal and link it in.
Collapse
Posted by Dan Wickstrom on
I don't think there is anything special about the qmail maildirs other than the fact that each message is stuffed in its own file.  I think the main advantage with qmail maildirs is the locking method that qmail uses guarantees that mail messages don't get lost or corrupted.

As far as processing each individual message, any library that implements mime encoding/decoding will probably work whether its written in java or tcl or whatever.  Look at how the java code currently processes a maildir file.  It just reads it in and passes it along to the javamail package.  No special qmail related processing is done for the message file.

In the openacs webmail module the java code is only used for access to the javamail api which does the mime encoding/decoding.  It would be quite easy to replace this code with something equivalent written in tcl.  As a start you might trying searching the dev.scriptics.com site to see if a mime library module already written in tcl exists.

Collapse
Posted by Michael A. Cleverly on
The new Tcl standard library (currently at version 0.6) has a MIME parsing package written by Marshall T. Rose. You can find it at http://dev.scriptics.com/software/tcllib. (It requires Tcl 8.2 so it wouldn't work with Tcl 7.6).
Collapse
Posted by good bye on
Thanks for the tip, Michael. Using the TCL mime library (and a couple others) I've managed to get mime-messages to send, now working on reading the maildirs. Should have it all done sometime tomorrow. Wait a few days for the docs, though.
Collapse
Posted by Don Baccus on
Danger, danger!

Tcl 8.2 has some serious memory leaks that have yet to be fixed.  AOLserver.com rolled back to 7.6 because of this (sigh).  aD is in a bit of a quandry as to what to do, last time I looked.

If you knock down your service each night you're probably OK but otherwise, your system will eventually hit the memory wall.

Just thought you might want to know this...

Collapse
Posted by good bye on
I'm now able to read maildirs. I need to clean up the code and document it, then I'll post it on my site.

Re: memory usage
Yeah, I know all about the memory leaks. aD now has (I think) a copy of purify. Hopefully they will solve that problem for me. Hasn't AOL run into this problem, or do they just run nsd76?

Collapse
Posted by Richard Li on
AOL.com runs 2.3.3. digitalcity runs aol30 with nsd76. we just got our copy today of purify.