SCRIPT_NAME - A virtual path to the script being executed, used for
Therefore, if a CGI application receives a SCRIPT_NAME that does not really
refer to the script itself, then this particular CGI implementation is
BROKEN by definition. A similar statement can also be extrapolated for
HTTP_HOST as well.
sqwebmail works correctly as a CGI application. You're just trying to make
it work in a non-CGI compatible environment.