#2144 - file attachment

Ticket modified by Klaus Leithoff at 2009/10/06 16:15
Tracking System: Bugs
Category: FelamiMail
Version: Version 1.6.002
Status: Open
Resolution: None
Completed: 90%
Priority: 5 - medium
Created By: Carlos Alberto
Assigned to: Klaus Leithoff
Summary: #2144 - file attachment
when attaching multiple files to a message, the content of the 1st file is used to all attachments.
the filenames in the message are correct, but the content of all attachments is equal to the 1st file attached.
eGroupWare 1.6.001 - svn revision 27320.
FreeBSD 7.1R-p3
apache-2.2.9_5
php5-5.2.8 PHP Scripting Language
php5-ctype-5.2.8 The ctype shared extension for php
php5-dom-5.2.8 The dom shared extension for php
php5-extensions-1.2 A “meta-port” to install PHP extensions
php5-gd-5.2.8 The gd shared extension for php
php5-gmp-5.2.8 The gmp shared extension for php
php5-imap-5.2.8 The imap shared extension for php
php5-ldap-5.2.8 The ldap shared extension for php
php5-mbstring-5.2.8 The mbstring shared extension for php
php5-mcrypt-5.2.8 The mcrypt shared extension for php
php5-mhash-5.2.8 The mhash shared extension for php
php5-openssl-5.2.8 The openssl shared extension for php
php5-pdo-5.2.8 The pdo shared extension for php
php5-pdo_pgsql-5.2.8 The pdo_pgsql shared extension for php
php5-pgsql-5.2.8 The pgsql shared extension for php
php5-posix-5.2.8 The posix shared extension for php
php5-session-5.2.8 The session shared extension for php
php5-simplexml-5.2.8 The simplexml shared extension for php
php5-soap-5.2.8 The soap shared extension for php
php5-sockets-5.2.8 The sockets shared extension for php
php5-spl-5.2.8 The spl shared extension for php
php5-tidy-5.2.8 The tidy shared extension for php
php5-xml-5.2.8 The xml shared extension for php
php5-xmlreader-5.2.8 The xmlreader shared extension for php
php5-xmlrpc-5.2.8 The xmlrpc shared extension for php
php5-xmlwriter-5.2.8 The xmlwriter shared extension for php
php5-zlib-5.2.8 The zlib shared extension for php
postgresql-client-8.3.3 PostgreSQL database (client)
pear-1.7.2 PEAR framework for PHP
pear-Auth-1.6.1 PEAR class for creating an authentication system
pear-Auth_SASL-1.0.2 PEAR abstraction of various SASL mechanism responses
pear-XML_Feed_Parser-1.0.2_1 Providing a unified API for handling Atom/RSS

Comment by Klaus Leithoff at 2009/10/06 16:15:
Would you care to test against Revision 28041 1.6.002 latest …
I changed the ID ing Method.
Comment by Carlos Alberto at 2009/07/01 15:55:
the microtime routine seems to have some problem.
if you use system time, or uploaded file name, or some random number from 1 to 1.000.000 instead microtime to generate the md5 hash to name the temporary file in /tmp, it should solve the issue.
Comment by Klaus Leithoff at 2009/07/01 15:22:
What we can see, is that the filename in /tmp/ is always the same.
Comment by Carlos Alberto at 2009/07/01 13:34:
Sorry about the delay, unfortunatelly few minutes ago I was able to do what you asked me for.
Attaching 2 files to a message, 1 with 6 bytes, and other with 12 bytes occured the following messages in system log:

Wed Jul 01 08:30:42 2009] [error] [client 10.248.255.8] Array\n(\n [signatureID] => -1\n [mailbox] => INBOX\n [mimeType] => html\n [attachments] => Array\n (\n [ff5ffe109ce0bab4664c50811f4d72a0] => Array\n (\n [name] => arquivoteste.txt\n [type] => text/plain\n [file] => /tmp/50007187374732c0fe1fb45d3ad7cd6cd24bphpujxtSL\n [size] => 9\n )\n\n )\n\n)\n, referer: https://intra.serranegra.sp.gov.br/egw/index.php?menuaction=felamimail.uicompose.fileSelector&composeid=7187374732c0fe1fb45d3ad7cd6cd24b
[Wed Jul 01 08:30:53 2009] [error] [client 10.248.255.8] Array\n(\n [signatureID] => -1\n [mailbox] => INBOX\n [mimeType] => html\n [attachments] => Array\n (\n [ff5ffe109ce0bab4664c50811f4d72a0] => Array\n (\n [name] => arquivoteste.txt\n [type] => text/plain\n [file] => /tmp/50007187374732c0fe1fb45d3ad7cd6cd24bphpujxtSL\n [size] => 9\n )\n\n [308c71b459c020182c04741d999db92f] => Array\n (\n [name] => teste.bas\n [type] => application/octet-stream\n [file] => /tmp/50007187374732c0fe1fb45d3ad7cd6cd24bphpujxtSL\n [size] => 6\n )\n\n )\n\n)\n, referer:
https://intra.serranegra.sp.gov.br/egw/index.php?menuaction=felamimail.uicompose.fileSelector&composeid=7187374732c0fe1fb45d3ad7cd6cd24b
[Wed Jul 01 08:31:20 2009] [error] [client 10.248.255.8] PHP Warning: unlink(/tmp/50007187374732c0fe1fb45d3ad7cd6cd24bphpujxtSL) [<a href="function.unlink">function.unlink</a>]: No such file or directory in /usr/local/www/egroupware/felamimail/inc/class.bocompose.inc.php on line 1048, referer: https://intra.serranegra.sp.gov.br/egw/index.php?menuaction=felamimail.uicompose.compose
Comment by Klaus Leithoff at 2009/07/01 11:27:
Anything new here?
What does the error_log say?
Comment by Klaus Leithoff at 1970/01/01 01:33:
Sorry I cannot confirm that on my system.
But true the systems available to me do not include FreeBSD 7.1R-p3
In fact no FreeBSDat all.
in line 124 of felamimail/inc/class.bocompose, there is an commented error_log.
uncomment the line, save run 2 uploads and have a look at the stuff in error_log of your webserver
I assume your error occurs in Function:
function getRandomString() {
mt_srand((float) microtime() * 1000000);
return md5(mt_rand (100000, 999999));
}

Linked entries:
http://www.egroupware.org/egroupware/index.php?menuaction=tracker.tracker_ui.edit&tr_id=2144&no_popup=1