in reply to Mail Progress Bar

I'd suggest you the use of NPH, which is the support for continuosly sending information to the client without closing the conection. This is how most webchat clients work. Here is a good explanation of a non-parsed headers cgi.
daniel