[imp] Using IMP with PHP running as a CHI

Sameh Ghane sw@anthologeek.net
Wed, 2 Oct 2002 19:26:22 +0200


Hi,

I am using IMP with PHP as a standalone (CGI). I read it was not a good idea,
but I saw no indication why. I know its drawbacks, and could not see how IMP
would trigger them.

And in fact, it worked. The only big issue I met was with keepalives on apache's
side.

But I still have an important issue: mail attachments are downloadable, but not
viewable. When I try to see one:

(request)
GET
	/horde/imp/view.php?thismailbox=INBOX&index=573&id=7&actionID=113&mime=XXXXXXXXX&f=/lassauge_05.jpg
	HTTP/1.0
Connection: Keep-Alive
User-Agent: Mozilla/4.77 [en] (X11; U; Linux 2.4.2 i386; Nav)
Pragma: no-cache
Host: mail.anthologeek.com
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, image/png, */*
Accept-Encoding: gzip
Accept-Language: fr-FR, en
Accept-Charset: iso-8859-1,*,utf-8
Cookie: Horde=XXXXXX; imp_key=XXXXXXXXXXXX

(answer)
HTTP/1.1 200 OK
Date: Wed, 02 Oct 2002 16:54:57 GMT
Server: Apache
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Content-Disposition: inline; filename=lassauge_05.jpg
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Vary: User-Agent
Content-Length: 165
Connection: close
Content-Type: text/html; charset=ISO-8859-1


<img src="view.php?actionID=113&index=573&mailbox=INBOX&id=7" border="0" alt="=?iso-8859-1?B?bGFzc2F1Z2VfMDUuanBn?="
title="=?iso-8859-1?B?bGFzc2F1Z2VfMDUuanBn?=" />


Then the browser tries to load the image, and gets the same answer: instead of
receiving a picture, it receives an html code.

It works fine when trying to download the file directly.

It works fine on another box with PHP as an apache module.

Any idea why PHP used as a CGI could lead into this problem ?

And beside this, what are the technical reasons why we should not use IMP with
PHP as a CGI ?

Cheers,

-- 
Sameh