Status / ToDo
acoliver Aug 21, 2003 7:18 PMThe Mail Services stuff is based on a protocol-independent thread-pooled JMX service. Presently SMTP is in the works. Contributers are welcome. Here is the present plan.
Status:
ServerMBean - protocol independent, thread pooling, socket listener,
delegates threads to a configured "protocol" which will be looked up by name
from the JMX bus. Unit tests say that when the garbage collector doesn't
muck things up it performs in 1-5ms per request (despite a bunch of
System.outs and stuff)
SMTPProtocol - Most of what I think we need is there. Mozilla mail is
happy, my unit tests pass. Uses a command pattern and passes off to
handlers for each of the SMTP commands. (Yeah don't hate me because I use
patterns, I use them because I'm lazy and don't want to describe in great
detail what "command pattern" says to those of you who read the GOF)
UserRepository - Plugs in to SMTPProtocol and says Yea or Nea for users
MailListeners - plugs in to SMTPProtocol, 1 or more. I have only 1
presently that says "Hi I got a mail, I'm letting it be garbage collected".
ATM Issues:
1. Figure out how to have a reasonable protocol independent but non-cracked
JMX setup for things like the UserRepository, MailListeners, etc. (Some
will be used in POP and IMAPProtocol, some won't, but the same ServerMBean
handles them all). I think I've figured it out... It kinda sucks that the
XML garbage will infect some of the code, but that's life I guess.
2. Figure out a nice bridge between RCPT TO: and JMS Queues or topics. I'm
thinking of just posting to 1 JMS topic and letting a message bean sort it
out into mail boxes or forward it to other beans. I'm also thinking of
posting to 2 instead (OnServer, OffServer). Meaning if Bill has an account
on the SMTP server he can send a mail via that server to
"acoliver@superlinksoftware.com". The OffServer topic would be things that
need to be sent elsewhere. The OnServer topic would be things that need to
be written to the DB for later retrieval. The obvious implication is that
you could swap out with your own MDBs and/or MessageListeners that did OTHER
things with the mails (like reply back "Why would you use a virus scanner
that sends me a return receipt for SoBIG.F, if it KNOWS that SoBIG.F forges
the mail headers you big sorry dolt!")
TODO next week (subject to change):
1. Work out both the above issues, writing a mail listener that does
something meaningful with the mails.
2. Figure out what pieces of SMTP I'm missing and any intricacies of SMTP
AUTH that I should have
3. Ditch my ProtocolFactory for JMX.
4. Research encrypted SMTP.
5. Hook up with Nukes so that there is a Mail-Forum bridge of sorts
The basic design lets me implement any Request/Response based protocol on a
multi-threaded basis. I just create a new "Protocol" and configure an
instance that uses it.