Ticket #1484973 (closed Bugs: fixed)

Opened 15 months ago

Last modified 10 months ago

Corrupted Attachments

Reported by: zeno.popovici Owned by: till
Priority: 3 Milestone: 0.2-beta
Component: MIME parsing Version: 0.1.1
Severity: major Keywords: attachment corrupt
Cc: zeno.popovici@…

Description (last modified by thomasb) (diff)

RC is corrupting attachments. It seems that only PDF and JPG attachments are sent correctly.

I've send a mail from RC Webmail with following attachments: doc, docx, ppt, pptx, xls, xlsx, pdf, zip, jpg.

What happens: If I try to open the e-mail in Outlook all attachments are corrupted except JPG and PDF ones. If I try to open the e-mail from RC Webmail, the attachments preview is garbled but I can download the file.

I tried everything but it seems to be RC related. I've attached the resulted documents and headers:

Return-Path: <xxxx@xxx>
Delivered-To: <xxxx@xxx>
Received: from xxxx.xxx (localhost.localdomain [127.0.0.1])
	by xxxx.xxx  (Postfix) with ESMTP id E97A713F79D
	for <xxxx@xxx>; Tue,  8 Apr 2008 15:01:45 +0300 (EEST)
Received: from localhost.localdomain [127.0.0.1]
  by BitDefender SMTP Proxy on localhost.localdomain [127.0.0.1]
  for localhost.localdomain [127.0.0.1]; Tue, 08 Apr 2008 15:01:46 +0300 (EEST)
Received: from xxxx.xxx (xxx.xxx [xxx.xxx.xxx.xxx])
	by xxxx.xxx (Postfix) with ESMTP id 8232C13F79A
	for <xxxx@xxx>; Tue,  8 Apr 2008 15:01:38 +0300 (EEST)
MIME-Version: 1.0
Date: Tue, 08 Apr 2008 15:01:37 +0300
From: zeno.popovici <xxxx@xxx>
To: Zeno Popovici <xxxx@xxx>
Subject: Attachment Test
Message-ID: <681445915bb9ff77b1cf5e340f8d7b21@xxxx.xx>
X-Sender: xxxx@xxx
Received: from xxxx.xxx [xxx.xxx.xxx.xxx] with HTTP/1.1 (POST); Tue, 08
	Apr 2008 15:01:37 +0300
User-Agent: WebMail ULBS/0.1
Content-Type: multipart/mixed;
	boundary="=_e2d7cb5dc548b4dcd89baf1da9b24801"

Attachments

Test.doc (35.9 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.docx (14.5 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.ppt (97.7 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.pptx (30.2 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.xls (24.0 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.xlsx (8.9 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.zip (1.2 KB) - added by zeno.popovici 15 months ago.
Garbled Result
Test.pdf (2.3 KB) - added by zeno.popovici 15 months ago.
Not corrupted
Test.2.doc (36.0 KB) - added by zeno.popovici 13 months ago.
Original Test Document
ATT00928.txt (36.0 KB) - added by zeno.popovici 12 months ago.
Latest File Result In Outlook
ATT00931.txt (99.0 KB) - added by zeno.popovici 12 months ago.
Latest File Result In Outlook

Change History

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Garbled Result

Changed 15 months ago by zeno.popovici

Not corrupted

  Changed 15 months ago by thomasb

  • description modified (diff)

(better wiki formatting)

follow-up: ↓ 3   Changed 14 months ago by till

Interesting to know would be how your configuration looks like, for example, are you using fileinfo (a php extension or not), or not (it's optional). Can you supply a sample message, are there any other errors in the logs?

Until then, nothing we can do to track this.

Maybe read this: http://trac.roundcube.net/wiki/Howto_ReportIssues

in reply to: ↑ 2   Changed 14 months ago by zeno.popovici

Replying to till:

Updated information:

One critical piece of information: The issue appears only when opening the e-mail with Outlook (Outlook Express works fine). Some other clients may be affected (The Bat, Eudora, etc.). The Outlook issue doesn't happen on a single computer, but was tested on several computers in our network.

1. Fileinfo is enabled

2. No errors appear in the logs.

3. PHP configuration

System 	Linux hera.ulbsibiu.ro 2.6.18-1.2798.fc6 #1 SMP Mon Oct 16 14:54:20 EDT 2006 i686
Build Date 	Oct 30 2006 13:10:06
Configure Command 	'./configure' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db4' '--with-curl' '--with-exec-dir=/usr/bin' '--with-freetype-dir' '--with-png-dir=/usr/lib' '--with-gd' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr/lib' '--with-openssl' '--with-png=/usr/include' '--with-aspell' '--with-xml' '--with-expat-dir' '--with-dom' '--with-dom-xslt' '--with-dom-exslt' '--with-xmlrpc' '--with-pcre-regex=/usr/include' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos' '--with-mysql' '--with-snmp' '--enable-ucd-snmp-hack' '--with-unixODBC=/usr' '--enable-memory-limit' '--enable-shmop' '--enable-calendar' '--enable-dbx' '--enable-dio'
Server API 	Apache 2.0 Handler
Virtual Directory Support 	disabled
Configuration File (php.ini) Path 	/etc/php.ini
Scan this dir for additional .ini files 	/etc/php.d
additional .ini files parsed 	/etc/php.d/eaccelerator.ini, /etc/php.d/fileinfo.ini, /etc/php.d/imap.ini, /etc/php.d/memcache.ini
PHP API 	20041225
PHP Extension 	20060613
Zend Extension 	220060519
Debug Build 	no
Thread Safety 	disabled
Zend Memory Manager 	enabled
IPv6 Support 	enabled
Registered PHP Streams 	php, file, data, http, ftp, compress.bzip2, compress.zlib, https, ftps
Registered Stream Socket Transports 	tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters 	string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, convert.iconv.*, bzip2.*, zlib.*

Zend logo This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
    with eAccelerator v0.9.5, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

PHP Credits
Configuration
PHP Core
Directive	Local Value	Master Value
allow_call_time_pass_reference	Off	Off
allow_url_fopen	Off	Off
allow_url_include	Off	Off
always_populate_raw_post_data	On	On
arg_separator.input	&	&
arg_separator.output	&	&
asp_tags	On	On
auto_append_file	no value	no value
auto_globals_jit	On	On
auto_prepend_file	no value	no value
browscap	no value	no value
default_charset	no value	no value
default_mimetype	text/html	text/html
define_syslog_variables	Off	Off
disable_classes	no value	no value
disable_functions	exec, shell_exec, passthru, error_log, ini_alter, dl, pfsockopen, openlog, syslog, readlink, symlink, link, leak, popen, escapeshellcmd, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, escapeshellarg, pcntl_exec	exec, shell_exec, passthru, error_log, ini_alter, dl, pfsockopen, openlog, syslog, readlink, symlink, link, leak, popen, escapeshellcmd, proc_close, proc_get_status, proc_nice, proc_open, proc_terminate, escapeshellarg, pcntl_exec
display_errors	Off	Off
display_startup_errors	Off	Off
docref_ext	no value	no value
docref_root	no value	no value
enable_dl	On	On
error_append_string	no value	no value
error_log	no value	no value
error_prepend_string	no value	no value
error_reporting	6135	6135
expose_php	On	On
extension_dir	/usr/lib/php/modules	/usr/lib/php/modules
file_uploads	On	On
highlight.bg	#FFFFFF	#FFFFFF
highlight.comment	#FF8000	#FF8000
highlight.default	#0000BB	#0000BB
highlight.html	#000000	#000000
highlight.keyword	#007700	#007700
highlight.string	#DD0000	#DD0000
html_errors	On	On
ignore_repeated_errors	On	On
ignore_repeated_source	On	On
ignore_user_abort	Off	Off
implicit_flush	Off	Off
include_path	.:/usr/share/pear	.:/usr/share/pear
log_errors	On	On
log_errors_max_len	1024	1024
magic_quotes_gpc	Off	Off
magic_quotes_runtime	Off	Off
magic_quotes_sybase	Off	Off
mail.force_extra_parameters	no value	no value
max_execution_time	30	30
max_input_time	300	300
memory_limit	100M	100M
open_basedir	no value	no value
output_buffering	1	1
output_handler	no value	no value
post_max_size	50M	50M
precision	14	14
realpath_cache_size	16K	16K
realpath_cache_ttl	120	120
register_argc_argv	On	On
register_globals	On	On
register_long_arrays	On	On
report_memleaks	On	On
report_zend_debug	On	On
safe_mode	Off	On
safe_mode_exec_dir	no value	no value
safe_mode_gid	Off	Off
safe_mode_include_dir	.:/php/includes:/usr/share/pear:./	.:/php/includes:/usr/share/pear:./
sendmail_from	no value	no value
sendmail_path	/usr/sbin/sendmail -t -i	/usr/sbin/sendmail -t -i
serialize_precision	100	100
short_open_tag	On	On
SMTP	localhost	localhost
smtp_port	25	25
sql.safe_mode	Off	Off
track_errors	Off	Off
unserialize_callback_func	no value	no value
upload_max_filesize	50M	50M
upload_tmp_dir	no value	no value
user_dir	no value	no value
variables_order	EGPCS	EGPCS
xmlrpc_error_number	0	0
xmlrpc_errors	Off	Off
y2k_compliance	On	On
zend.ze1_compatibility_mode	Off	Off

apache2handler
Apache Version 	Apache/2.2.4 (Fedora)
Apache API Version 	20051115
User/Group 	apache(5500)/5500
Max Requests 	Per Child: 4000 - Keep Alive: on - Max Per Connection: 100
Timeouts 	Connection: 300 - Keep-Alive: 15
Virtual Server 	Yes
Server Root 	/etc/httpd
Loaded Modules 	core prefork http_core mod_so mod_auth_basic mod_auth_digest mod_authn_file mod_authn_alias mod_authn_anon mod_authn_dbm mod_authn_default mod_authz_host mod_authz_user mod_authz_owner mod_authz_groupfile mod_authz_dbm mod_authz_default util_ldap mod_authnz_ldap mod_include mod_log_config mod_logio mod_env mod_ext_filter mod_mime_magic mod_expires mod_deflate mod_headers mod_usertrack mod_setenvif mod_mime mod_dav mod_status mod_autoindex mod_info mod_dav_fs mod_vhost_alias mod_negotiation mod_dir mod_actions mod_speling mod_userdir mod_alias mod_rewrite mod_proxy mod_proxy_balancer mod_proxy_ftp mod_proxy_http mod_proxy_connect mod_cache mod_suexec mod_disk_cache mod_file_cache mod_mem_cache mod_cgi mod_auth_kerb mod_auth_mysql mod_perl mod_php5 mod_proxy_ajp mod_python mod_ssl

Directive	Local Value	Master Value
engine	1	1
last_modified	0	0
xbithack	0	0

Apache Environment
Variable	Value
HTTP_USER_AGENT 	Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
HTTP_ACCEPT 	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_LANGUAGE 	en-us,en;q=0.5
HTTP_ACCEPT_ENCODING 	gzip,deflate
HTTP_ACCEPT_CHARSET 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
HTTP_KEEP_ALIVE 	300
HTTP_CONNECTION 	keep-alive
PATH 	/sbin:/usr/sbin:/bin:/usr/bin
SERVER_SIGNATURE 	<address>Apache/2.2.4 (Fedora) Server at webmail.ulbsibiu.ro Port 80</address>
REMOTE_PORT 	32748
GATEWAY_INTERFACE 	CGI/1.1
SERVER_PROTOCOL 	HTTP/1.1
REQUEST_METHOD 	GET
QUERY_STRING 	no value
REQUEST_URI 	/phpinfo.php
SCRIPT_NAME 	/phpinfo.php

HTTP Headers Information
HTTP Request Headers
HTTP Request 	GET /phpinfo.php HTTP/1.1
Host 	webmail.ulbsibiu.ro
User-Agent 	Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9b5) Gecko/2008032620 Firefox/3.0b5
Accept 	text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language 	en-us,en;q=0.5
Accept-Encoding 	gzip,deflate
Accept-Charset 	ISO-8859-1,utf-8;q=0.7,*;q=0.7
Keep-Alive 	300
Connection 	keep-alive
HTTP Response Headers
X-Powered-By 	PHP/5.2.0RC7-dev

bcmath
BCMath support 	enabled

bz2
BZip2 Support 	Enabled
Stream Wrapper support 	compress.bz2://
Stream Filter support 	bzip2.decompress, bzip2.compress
BZip2 Version 	1.0.3, 15-Feb-2005

calendar
Calendar support 	enabled

ctype
ctype functions 	enabled

curl
cURL support 	enabled
cURL Information 	libcurl/7.15.5 OpenSSL/0.9.8b zlib/1.2.3 libidn/0.6.5

date
date/time support 	enabled
Timezone Database Version 	2006.14
Timezone Database 	internal
Default timezone 	Europe/Bucharest

Directive	Local Value	Master Value
date.default_latitude	31.7667	31.7667
date.default_longitude	35.2333	35.2333
date.sunrise_zenith	90.583333	90.583333
date.sunset_zenith	90.583333	90.583333
date.timezone	Europe/Bucharest	Europe/Bucharest

dba
DBA support 	enabled
Supported handlers 	db4

dom
DOM/XML 	enabled
DOM/XML API Version 	20031129
libxml Version 	2.6.26
HTML Support 	enabled
XPath Support 	enabled
XPointer Support 	enabled
Schema Support 	enabled
RelaxNG Support 	enabled

eAccelerator
eAccelerator support	enabled
Version 	0.9.5
Caching Enabled 	true
Optimizer Enabled 	true
Memory Size 	33,554,396 Bytes
Memory Available 	7,648 Bytes
Memory Allocated 	33,546,748 Bytes
Cached Scripts 	763
Removed Scripts 	0
Cached Keys 	0

Directive	Local Value	Master Value
eaccelerator.allowed_admin_path	no value	no value
eaccelerator.cache_dir	/var/cache/php-eaccelerator	/var/cache/php-eaccelerator
eaccelerator.check_mtime	1	1
eaccelerator.compress	1	1
eaccelerator.compress_level	9	9
eaccelerator.debug	0	0
eaccelerator.enable	1	1
eaccelerator.filter	no value	no value
eaccelerator.log_file	no value	no value
eaccelerator.name_space	no value	no value
eaccelerator.optimizer	1	1
eaccelerator.shm_max	0	0
eaccelerator.shm_only	0	0
eaccelerator.shm_prune_period	0	0
eaccelerator.shm_size	0	0
eaccelerator.shm_ttl	3600	3600

exif
EXIF Support 	enabled
EXIF Version 	1.4 $Id: exif.c,v 1.173.2.5.2.4 2006/10/10 22:22:43 tony2001 Exp $
Supported EXIF Version 	0220
Supported filetypes 	JPEG,TIFF

fileinfo
fileinfo support	enabled

filter
Input Validation and Filtering	enabled
Revision 	$Revision: 1.52.2.25 $

Directive	Local Value	Master Value
filter.default	unsafe_raw	unsafe_raw
filter.default_flags	no value	no value

ftp
FTP support 	enabled

gd
GD Support 	enabled
GD Version 	bundled (2.0.28 compatible)
FreeType Support 	enabled
FreeType Linkage 	with freetype
FreeType Version 	2.2.1
GIF Read Support 	enabled
GIF Create Support 	enabled
JPG Support 	enabled
PNG Support 	enabled
WBMP Support 	enabled
XBM Support 	enabled

gettext
GetText Support 	enabled

gmp
gmp support 	enabled

hash
hash support 	enabled
Hashing Engines 	md4 md5 sha1 sha256 sha384 sha512 ripemd128 ripemd160 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru gost adler32 crc32 crc32b haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5

iconv
iconv support 	enabled
iconv implementation 	glibc
iconv library version 	2.5

Directive	Local Value	Master Value
iconv.input_encoding	ISO-8859-1	ISO-8859-1
iconv.internal_encoding	ISO-8859-1	ISO-8859-1
iconv.output_encoding	ISO-8859-1	ISO-8859-1

imap
IMAP c-Client Version 	2004
SSL Support 	enabled
Kerberos Support 	enabled

json
json support 	enabled
json version 	1.2.1

libxml
libXML support 	active
libXML Version 	2.6.26
libXML streams 	enabled

mbstring
Multibyte Support 	enabled
Multibyte string engine 	libmbfl
Multibyte (japanese) regex support 	enabled
Multibyte regex (oniguruma) version 	4.4.4
Multibyte regex (oniguruma) backtrack check 	On

mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.

Directive	Local Value	Master Value
mbstring.detect_order	no value	no value
mbstring.encoding_translation	Off	Off
mbstring.func_overload	0	0
mbstring.http_input	pass	pass
mbstring.http_output	pass	pass
mbstring.internal_encoding	no value	no value
mbstring.language	neutral	neutral
mbstring.strict_detection	Off	Off
mbstring.substitute_character	no value	no value

mcrypt
mcrypt support	enabled
Version 	2.5.7
Api No 	20021217
Supported ciphers 	cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes 	cbc cfb ctr ecb ncfb nofb ofb stream

Directive	Local Value	Master Value
mcrypt.algorithms_dir	no value	no value
mcrypt.modes_dir	no value	no value

memcache
memcache support	enabled
Active persistent connections 	0
Revision 	$Revision: 1.62 $

Directive	Local Value	Master Value
memcache.allow_failover	1	1
memcache.chunk_size	8192	8192
memcache.default_port	11211	11211
memcache.max_failover_attempts	20	20

mime_magic
mime_magic support	enabled

Directive	Local Value	Master Value
mime_magic.debug	Off	Off
mime_magic.magicfile	/etc/httpd/conf/magic	/etc/httpd/conf/magic

mysql
MySQL Support	enabled
Active Persistent Links 	0
Active Links 	0
Client API version 	5.0.22
MYSQL_MODULE_TYPE 	external
MYSQL_SOCKET 	/var/lib/mysql/mysql.sock
MYSQL_INCLUDE 	-I/usr/include/mysql
MYSQL_LIBS 	-L/usr/lib/mysql -lmysqlclient

Directive	Local Value	Master Value
mysql.allow_persistent	On	On
mysql.connect_timeout	60	60
mysql.default_host	no value	no value
mysql.default_password	no value	no value
mysql.default_port	no value	no value
mysql.default_socket	no value	no value
mysql.default_user	no value	no value
mysql.max_links	Unlimited	Unlimited
mysql.max_persistent	Unlimited	Unlimited
mysql.trace_mode	Off	Off

odbc
ODBC Support	enabled
Active Persistent Links 	0
Active Links 	0
ODBC library 	unixODBC
ODBC_INCLUDE 	-I/usr/include
ODBC_LFLAGS 	-L/usr/lib
ODBC_LIBS 	-lodbc

Directive	Local Value	Master Value
odbc.allow_persistent	On	On
odbc.check_persistent	On	On
odbc.default_db	no value	no value
odbc.default_pw	no value	no value
odbc.default_user	no value	no value
odbc.defaultbinmode	return as is	return as is
odbc.defaultlrl	return up to 4096 bytes	return up to 4096 bytes
odbc.max_links	Unlimited	Unlimited
odbc.max_persistent	Unlimited	Unlimited

openssl
OpenSSL support 	enabled
OpenSSL Version 	OpenSSL 0.9.8b 04 May 2006

pcre
PCRE (Perl Compatible Regular Expressions) Support 	enabled
PCRE Library Version 	6.6 06-Feb-2006

PDO
PDO support	enabled
PDO drivers 	sqlite2, sqlite

pdo_sqlite
PDO Driver for SQLite 3.x	enabled
PECL Module version 	(bundled) 1.0.1 $Id: pdo_sqlite.c,v 1.10.2.6 2006/01/01 12:50:12 sniper Exp $
SQLite Library 	3.3.7

posix
Revision 	$Revision: 1.70.2.3.2.6 $

Reflection
Reflection	enabled
Version 	$Id: php_reflection.c,v 1.164.2.33.2.31 2006/10/18 16:35:15 johannes Exp $

session
Session Support 	enabled
Registered save handlers 	files user sqlite
Registered serializer handlers 	php php_binary wddx

Directive	Local Value	Master Value
session.auto_start	Off	Off
session.bug_compat_42	Off	Off
session.bug_compat_warn	On	On
session.cache_expire	480	480
session.cache_limiter	nocache	nocache
session.cookie_domain	ulbsibiu.ro	no value
session.cookie_httponly	Off	Off
session.cookie_lifetime	0	0
session.cookie_path	/	/
session.cookie_secure	Off	Off
session.entropy_file	no value	no value
session.entropy_length	0	0
session.gc_divisor	1000	1000
session.gc_maxlifetime	28800	28800
session.gc_probability	1	1
session.hash_bits_per_character	5	5
session.hash_function	0	0
session.name	PHPSESSID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	files	files
session.save_path	/var/lib/php/session	/var/lib/php/session
session.serialize_handler	php	php
session.use_cookies	On	On
session.use_only_cookies	On	On
session.use_trans_sid	0	0

shmop
shmop support 	enabled

SimpleXML
Simplexml support	enabled
Revision 	$Revision: 1.151.2.22.2.15 $
Schema support 	enabled

snmp
NET-SNMP Support 	enabled
NET-SNMP Version 	5.3.1

sockets
Sockets Support 	enabled

SPL
SPL support	enabled
Interfaces 	Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes 	AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, DirectoryIterator, DomainException, EmptyIterator, FilterIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RegexIterator, RuntimeException, SimpleXMLIterator, SplFileInfo, SplFileObject, SplObjectStorage, SplTempFileObject, UnderflowException, UnexpectedValueException

SQLite
SQLite support	enabled
PECL Module version 	2.0-dev $Id: sqlite.c,v 1.166.2.13.2.5 2006/10/20 21:28:31 tony2001 Exp $
SQLite Library 	2.8.17
SQLite Encoding 	iso8859

Directive	Local Value	Master Value
sqlite.assoc_case	0	0

standard
Regex Library 	Bundled library enabled
Dynamic Library Support 	enabled
Path to sendmail 	/usr/sbin/sendmail -t -i

Directive	Local Value	Master Value
assert.active	1	1
assert.bail	0	0
assert.callback	no value	no value
assert.quiet_eval	0	0
assert.warning	1	1
auto_detect_line_endings	0	0
default_socket_timeout	60	60
safe_mode_allowed_env_vars	PHP_	PHP_
safe_mode_protected_env_vars	LD_LIBRARY_PATH	LD_LIBRARY_PATH
url_rewriter.tags	a=href,area=href,frame=src,input=src,form=fakeentry	a=href,area=href,frame=src,input=src,form=fakeentry
user_agent	no value	no value

tokenizer
Tokenizer Support 	enabled

wddx
WDDX Support	enabled
WDDX Session Serializer 	enabled

xml
XML Support 	active
XML Namespace Support 	active
libxml2 Version 	2.6.26

xmlreader
XMLReader 	enabled

xmlrpc
core library version 	xmlrpc-epi v. 0.51
php extension version 	0.51
author 	Dan Libby
homepage 	http://xmlrpc-epi.sourceforge.net
open sourced by 	Epinions.com

xmlwriter
XMLWriter 	enabled

zlib
ZLib Support 	enabled
Stream Wrapper support 	compress.zlib://
Stream Filter support 	zlib.inflate, zlib.deflate
Compiled Version 	1.2.3
Linked Version 	1.2.3

Directive	Local Value	Master Value
zlib.output_compression	On	On
zlib.output_compression_level	-1	-1
zlib.output_handler	no value	no value

Additional Modules
Module Name
sysvsem
sysvshm

Environment
Variable	Value
TERM 	xterm
PATH 	/sbin:/usr/sbin:/bin:/usr/bin
PWD 	/
LANG 	C
SHLVL 	2
_ 	/usr/sbin/httpd
KRB5RCACHETYPE 	none

PHP Variables
Variable	Value
PHP_SELF 	/phpinfo.php

Array
(
)

_SERVER["argc"]	0
_ENV["TERM"]	xterm
_ENV["PATH"]	/sbin:/usr/sbin:/bin:/usr/bin
_ENV["PWD"]	/
_ENV["LANG"]	C
_ENV["SHLVL"]	2
_ENV["_"]	/usr/sbin/httpd
_ENV["KRB5RCACHETYPE"]	none

  Changed 14 months ago by zeno.popovici

This bug seems to be related to this one: http://trac.roundcube.net/ticket/1485034

follow-up: ↓ 6   Changed 14 months ago by sibra

i think something is wrong here:

function rc_mime_content_type($path, $failover = 'unknown/unknown')
{
    global $CONFIG;

    $mime_magic = $CONFIG['mime_magic'];

    if (function_exists('mime_content_type')) {
        return mime_content_type($path);
    }
    if (!extension_loaded('fileinfo')) { 
        if (!dl('fileinfo.' . PHP_SHLIB_SUFFIX)) {
            return $failover;
        }
    }
    $finfo = finfo_open(FILEINFO_MIME, $mime_magic);
    if (!$finfo) {
        return $failover;
    }
    $mime_type = finfo_file($finfo,$path);
    if (!$mime_type) {
        return $failover;
    }
    finfo_close($finfo);

    return $mime_type;
}

because if i send an attachement thru version 0.1-rc2 it works and with version 0.1.1 it does not.

in reply to: ↑ 5   Changed 13 months ago by till

  • owner set to till
  • status changed from new to assigned

Replying to sibra:

i think something is wrong here: {{{ function rc_mime_content_type($path, $failover = 'unknown/unknown') { global $CONFIG; $mime_magic = $CONFIGmime_magic?; if (function_exists('mime_content_type')) { return mime_content_type($path); } if (!extension_loaded('fileinfo')) { if (!dl('fileinfo.' . PHP_SHLIB_SUFFIX)) { return $failover; } } $finfo = finfo_open(FILEINFO_MIME, $mime_magic); if (!$finfo) { return $failover; } $mime_type = finfo_file($finfo,$path); if (!$mime_type) { return $failover; } finfo_close($finfo); return $mime_type; } }}}

Fileinfo is the way to go in PHP. The mime type guessed by the upload function can be changed by the client, which opens the door for potential exploits. The way this works is, that the "guessed" mime type is passed into rc_mime_content_type() as failover.

Then we attempt to use the PHP function or the fileinfo module to guess the mime type - if all fails, we'll return the "guessed" from the upload anyway.

If you could supply one file that doesn't parse correctly when you attach it, that would help a lot.

  Changed 13 months ago by till

Just to make sure - I cannot do anything with the garbled result. I'd like the original you are uploading to verify if this breaks on my system too.

Changed 13 months ago by zeno.popovici

Original Test Document

  Changed 13 months ago by zeno.popovici

I've uploaded the original test document before it was sent trough RC.

  Changed 13 months ago by Slug

I am seeing the exact same thing with the exception of PDF are also corrupted (shows up at the other end as *.*.txt. Can someone tell me where do I find "Fileinfo" as it is NOT in my list of extensions. I am using 5.2.4 (windows).Thanks

  Changed 13 months ago by Slug

Just rechecked, remove *.*.txt from my above post. (does not change extension). But is corrupted.

  Changed 13 months ago by sibra

after hours of searching what could have been wrong, i finally found out, that the function _file2str() in /program/lib/Mail/mime.php produces a wrong output.

$cont = fread($fd, $filesize); only reads in 8192 bytes, no matter of what value $filesize is.

i replaced fread() with $conf = file_get_contents($filename); and everything worked fine!

php.net suggests to use file_get_contents() instead of fread() if you want to read a file into a string.

  Changed 13 months ago by alec

  • status changed from assigned to closed
  • resolution set to fixed

Fixed in r1530. PEAR::Mail_Mime package updated.

  Changed 12 months ago by zeno.popovici

Documents are fine now, but they appear as: "ATT00928.txt" in Outlook. If you rename them to .doc or the original extension, they will open.

It's still a naming problem.

I've tested it with the latest version.

  Changed 12 months ago by alec

  • status changed from closed to reopened
  • resolution fixed deleted

Changed 12 months ago by zeno.popovici

Latest File Result In Outlook

Changed 12 months ago by zeno.popovici

Latest File Result In Outlook

  Changed 12 months ago by zeno.popovici

I've uploaded the requested documents.

  Changed 11 months ago by zeno.popovici

Documents are fine now, but they appear as: "ATT00928.txt" in Outlook. If you rename them to .doc or the original extension, they will open.

It's still a naming problem.

I've tested it with the latest version.

  Changed 11 months ago by alec

Please try svn version and attach whole message (headers and body).

  Changed 11 months ago by alec

  • component changed from Core functionality to MIME parsing

  Changed 10 months ago by alec

  • status changed from reopened to closed
  • resolution set to fixed

Issue fixed, remaining Outlook naming problem is a dupe of #1485320

Note: See TracTickets for help on using tickets.