SiT! Bugs - SiT!
View Issue Details
0000987SiT!outbound emailpublic2009-10-19 10:322010-01-23 19:02
nicdev 
nicdev 
normalmajoralways
closedfixed 
WindowsWindows Server2000+Later
3.50 
3.513.51 
0000987: When adding an attachment 'MAX_FILE_SIZE' does not work
When sending a mail from an incident, and we choose a file to attach (which is bigger than the php limitation set in php.ini), the script does not return an error to say the file is too big.

When we send the email, the email is sent "with the message - email sent ok" but the message has not attachment and no warning. The message actually arrives at the intended recipient, but has no attachment.

To the engineer/user it looks like everything is ok, but it is not.
No tags attached.
Issue History
2009-10-19 10:32nicdevNew Issue
2009-10-20 10:58nicdevNote Added: 0002110
2009-10-20 10:59nicdevNote Edited: 0002110bug_revision_view_page.php?bugnote_id=2110#r43
2009-10-20 10:59nicdevStatusnew => assigned
2009-10-20 10:59nicdevAssigned To => nicdev
2009-10-20 10:59nicdevStatusassigned => confirmed
2009-10-22 14:24nicdevNote Added: 0002113
2009-10-22 14:24nicdevStatusconfirmed => resolved
2009-10-22 14:24nicdevFixed in Version => Current SVN
2009-10-22 14:24nicdevResolutionopen => fixed
2009-10-23 14:12ivanTarget Version => 3.50p1
2009-12-12 13:55ivanNote Added: 0002224
2010-01-23 19:01ivanFixed in VersionCurrent SVN => 3.51
2010-01-23 19:02ivanNote Added: 0002323
2010-01-23 19:02ivanStatusresolved => closed

Notes
(0002110)
nicdev   
2009-10-20 10:58   
(edited on: 2009-10-20 10:59)
In fact there are 2 issues here related to the 2 limits set in php.ini.
The first limit is "upload_max_filesize"
and the second is "post_max_size". The 2 are quite different but related because when we attach a file PHP uses the POST method to send the binary data to the server.

If you attach a file that is bigger than (>) "post_max_size":
There is a bug in PHP (< version 5.2.2) that causes the entire $_FILES and $_POST globals to be reset to ''. In this case the SiT incident_email.php script cannot continue due to empty POST values and the script returns to the first "send email" step or the "last draft" step. (read more here: http://bugs.php.net/bug.php?id=40921 [^])

If you attach a file that is smaller than (<) "post_max_size" but bigger than (>) "upload_max_filesize" then the email sent "success" even though the attachment did not get sent with the email. For this issue i have changed the incident_email.php script.

I will post the details of the commit ASAP

(0002113)
nicdev   
2009-10-22 14:24   
For the changed code see:
http://github.com/nicdev007/sitracker/commit/f8e2b4e39d5d99f876fc6692ce50a785254d9041 [^]
(0002224)
ivan   
2009-12-12 13:55   
Also ported to svn trunk as r5964
(0002323)
ivan   
2010-01-23 19:02   
Fix released in v3.51 which is now available