Re: Re: Premature end of script headers: sqwebmail

Brian Candler <[email protected]> Tue, 1 Jun 2004 13:07:22 +0100
Newsgroups gmane.mail.sqwebmail
Message-ID <[email protected]>
On Tue, Jun 01, 2004 at 03:59:06AM -0700, Sagara Wijetunga wrote:
> The objective of my patch is to get the login domain
> from an environment variable named LOGINDOMAIN, not
> from CGI. So that users are not required to type or
> select the domain name.

No need to hack code. Just set the logindomain as a hidden form variable;
replace

[#h#]

with something like

<input type="hidden" name="logindomain" value="example.com">

in login.html / expired.html / invalid.html

> This code compiles without any error, but it develops
> Apache Error 500 at run time with the following error
> message:
> Premature end of script headers: sqwebmail

I would guess a null pointer error (you haven't initialised the environment
variable before starting sqwebmaild, or passed it from sqwebmail)

> I introduced LOGINDOMAIN to the safe_env_lst[] of
> suexec.c of Apache and httpd.conf and ssl.conf. My
> other CGI programs run under suEXEC can read the
> LOGINDOMAIN environment variable and I can see its
> value.
> 
> Does the sqwebmail CGI stub binary drops any
> environment variable that it was not designed to use?

Correct. It only sends certain environment variables.

> If that is the case, how do I introduce  LOGINDOMAIN
> environment variable to sqwebmail CGI stub binary?

If you're going to hack code, and you know how to program in C, then it's
easy to find.

Brian.