Well, I got past the authentication hurdle. Part of the problem of trying to mix two different types of authentication. Java wants to set a cookie, but sqwebmail wants to use a long URL with login information. So I hacked in a special type of cookie-based login for sqwebmail.
Also, sqwebmail currently writes out a lot of its own HTML. Too much HTML. So I'm changing it so its substitutions have parameters. The parameters will be HTML tags. You'll still be able to edit the raw HTML using an HTML editor, although some things might look funny.
Work, work, work, work. Back to work.