Running imp on win32 (asking for a long list of small fixes, tricks, etc.)

Raoul EMIN raoul.emin@bigfoot.com
Thu, 19 Apr 2001 17:21:02 +0200


I had some problem with my mail, please forgive me if you already received
this message.

----- Original Message -----





Dear All.

This is a long post.

When it comes to free webbased mail, they are not so many open options for
the
windows world. I consequently implemented imp 2.2 in our Microsoft IIS
server.
I am still experiencing a few bugs related to the win32 platform.

- Hard Coded "/tmp" strings for the temp folder
- Bad mail headers
- Buggy generic mail function call in horde.lib line 1137
- A few more wishes.


=========
My Config
=========

Database: MySQL
NT: v4.0 SP6 (tested on workstation FR and server US)
PHP : 4.0.2 (the DLL ISAPI filter crashes, but using instead PHP.EXE as a
filter results satisfactory). It is much faster than version 3.0
PHPLib : the suggested in-house PHPLib does not work on my NT workstation
for
it makes heavy use of Posix functions. I am consequently using a slightly
modified version 7.2b: the $sid var is not properly defined in the include
files for MySQL support, the freeze function was modified according to IMP
FAQs.
Mail server: Vintramail pro, a nice freeware for win32. Vintramail MTA is a
Win32 port of the popular Sendmail MTA.
IMP: 2.2.2

=============================
Problem 1 : hard coded "tmp/"
=============================

In compose.php3 there is a nice call to a function that returns the temp
folder
(using the upload temp path defined in php.ini). If the function fails to
identify temp path it will return "/tmp". This default value is not
applicable
to the NT platform that should uses C:/Temp instead. Would it be possible to
peform a platform test and send C:/temp or /tmp accordingly?

This is more of an esthetic bug request since we should all properly setup
the
php.ini file.

The problem gets more complex when it comes to the mime attachment viewers:
instead of the above mentioned function every external viewers assume the
attachments are tmporarily downloaded in /tmp (the string is hard coded).
Would
it be possible to change this /tmp string  by the functon used in
compose.php3


============================
Problem 2 : Bad Mail Headers
============================

They are only a few free imap / smtp servers available for the win32
platform.
The only decent one we have tried so far is VintraMail Pro and its sendmail
clone MTA. The server is just like the old sendmail apps: slightly buggy.

1. it badly handles mime conversion:

the conversion from 8bit to quoted printable itself is OK, except that the
new
headers generated are fairly confusing the old one not being removed (see
bellow chuck message bellow).
> X-MIME-encoding: 8 bit
> X-MIME-Autoconverted: from 8bit to quoted-printable by alumni.vtx.ch
> X-MIME-encoding: quoted-printable
>>chuck :Whatever that smtp server is, it's responsible for the conversion
>>and not removing the first header. That's the problem you need to fix.

As a result when sending from my buggy smtp server a mail to an even more
buggy
exhange server finaly read by the marvelous outlook, here is what appends:

IMP sends the message as 8bit
My server talks to the exchange machine that does not inform him it can
handle
8bit.
My server consequently makes a conversion to quoted printable and lets 2
X-Mime
encoding headers.
Outlook when it reads mail headers stops when it finds the first occurrence
of
the X-MiME-Encoding description and does not take into account the second
one
(I have to mention IMP handles this last point much better)
My recipient receives a message in quoted printable displayed as 8bit.

Can anyone tell me if it is possible to setup the sendmail.cf file so as to
skip any auto-conversion process?

Alternatively, is there anyway of setting up imp so that it uses quoted
printable encoding (my server in that case will stop making bad
conversions).

A small temporary solution would consist in using my ISP smtp server instead
of
localost with suboptimal performances

2. It does not accept command line options

See bad generic mail function.

3. Their website is down

and so is their technical support...


=====================================
Problem 3 : Bad generic mail function
=====================================

While sending mail, imp tries to use sendmail and then the generic mail
function. Since my MTA is a clone of the sendmail I cannot use the standard
sendmail.exe apps (sendmail already running warning). I would like to use
instead a PC command line utility which is fairly nice: Postie.

Syntax: postie.exe -host:localhost -to:$recipient -from:$sender -copy:$cc -
bcc:$bcc -content:$filename.

Can anyone provide me with some assistance on creating the outputfilename
out
of the body variable and passing all the above mentioned params to postie? I
think the routine might be similar to the one used for the wordview
converter.

This could be used as a nice Win32 alternative to the Unix-specific sendmail
routine.

Our  imp is temporarily using the generic mail function instead of the
sendmail
command and there is systematically an error on line 1137 (when calling mail
(...) ) if the cc field is not empty. For the time being I added a
javascript
bit of code that copies the cc field into the to field before posting the
form.

1. Is there a way to get a more specific message than "server error in
horde.lib line xxxx"

2. Is the generic "mail()" function specific to horde  (i.e can be
debugged),
or built in PHP (i.e cannot easily be debugged)

3. I also noticed that when calling the mail function we use some functions
to
extract the TO, SUBJECT, ETC. elements from the envelope would it be
possible
that the function extracting the CC field causes the problem. Where is this
function located?


===========
More wishes
===========

1. Where can I adjust the size of the "help windows", I found a nice var.
for
the compose window but nothing for this one.
2. Does anyone knows about a PC version of wordview, otherwise can anyone
give
me its syntax and output: I have my own .doc converter that might be adapted
and used as a clone.
3. "This has not been coded yet." message when clicking on the logout
button.


=====================
My small contribution
=====================

I have packaged everything in a nice windows installer app. Provided one has
vintramail, IIS4 and mysql installed all php, phplib, create database, etc.
is
done automatically. This small application still lacks the above mentioned
fixes plus a lot of spellcheking.





IN SHORT:

A - MY FIRST WISH :  SYSTEMATIC USE OF THE UPLOAD TEMP PATH INSTEAD OF
HARDCODING /tmp. PLUS MODIFYING THE FUNCTION SO THAT IT TAKES INTO ACCOUNT
THAT
THE DEFAULT VALUE SHOULD BE C:/temp IF THE PLATFORM IS WIN32

B - MY SECOND WISH : SENDMAIL WRAPER : CAN ANYONE BE SO KIND AS TO PROVIDE
ME
WITH THE FIVE LINES OF CODES REQUIRED TO USE POSTIE.EXE INSTEAD OF SENDMAIL
(my
knowledge of php is well bellow average :) ).

C - ONE TIP REQUIRED : HOW CAN I SETUP IMP TO USE QUOTED PRINTABLE ENCODING
INSTEAD OF 8BIT.

D - ANOTHER TIP : HOW CAN I SETUP THE GENERIC MAIL() FUNCTION TO USE ANOTHER
SMTP SERVER THAN LOCALHOST.




Thank you for reading my long list of questions and even taking time to
provide
me with some answers.

Raoul Emin



-------------------------------------------------
This mail sent through IMP: www.eap-network.com