Reading the code, I see that the sqwebmail wrapper passes environment variables then the whole HTTP socket to sqwebmaild. Superficially it doesn't seem like a big effort to get sqwebmaild to use stdin instead, then it could be a regular CGI again, no?
It'll probably work just to get rid of the entire reading code, and reinstall it as cgi root.
There might be some fine-tuning issues regarding authentication, though.
pgp00000.pgp
Description: PGP signature
