Trying to prevent large file attachments in Squirrelmail, on U8.10S.
xnooby at gmail.com
Wed Dec 24 15:53:11 UTC 2008
On Tue, Dec 23, 2008 at 4:47 PM, Chris Mohler <cr33dog at gmail.com> wrote:
> On Wed, Dec 24, 2008 at 3:46 PM, Chris Mohler <cr33dog at gmail.com> wrote:
>> On Wed, Dec 24, 2008 at 3:33 PM, Xn Nooby <xnooby at gmail.com> wrote:
>>> Is it possible to prevent Squirrelmail users from uploading large
>>> files to a server running Squirrelmail? My testing seems to indicate
>>> that the attachment size limits enforced by Squirrelmail take place
>>> *after* the file has been uploaded - at which time Squirrelmail aborts
>>> the entire message. I will have some remote users, and I do not want
>>> them to be able to upload files that are over a limit (say 10MB).
>>> If a remote user tries to attach a 500MB attachment to their email, I
>>> don't want them to upload the entire 500MB file, only to then have SM
>>> abort the message. I want it to fail immediately, or after the 10MB
>>> limit has been reached.
>>> I though there was a way to do this in Apache or PHP, but have been
>>> unable to find it. I am running Ubuntu Server 8.10 with Apache,
>>> Postfix, Dovecot, and Squirrelmail.
>>> Any suggestions on how to get the file attaching process to abort
>>> before it uploads the entire 500MB file?
>> Check the "MAX POST SIZE" (similar to that anyway) setting in php.ini.
>> That will fail at the point that the limit is reached. Of course,
>> that's a site-wide setting though...
> Oops - this is actually the correct option:
> ; Maximum allowed size for uploaded files.
> upload_max_filesize = 2M
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
I have that set already, it seems to take effect only after the file
is uploaded. The file the value is in is located at
/etc/php5/apache2/php.ini. I'm beginning to think there is no way to
limit the size until it is uploaded. Perhaps there is some header
data that could be checked that contains the file size?
More information about the ubuntu-users