[rt-devel] questions regarding limit attachment size
shawn at bestpractical.com
Tue May 12 11:28:28 EDT 2015
> 2015/05/12 8:49、Christian Loos <cloos at netcologne.de> のメール：
> I have some questions regarding the functions to limit the attachment
> size ($MaxAttachmentSize and $DropLongAttachments set):
> 1. Is it really necessary to log the first 60 characters of a dropped
> attachment ?
I think this is done to make dropped attachments easier to debug. One of the ways to triage any RT problem is to inspect the logs, and including a snippet of the email helps in identifying the problem.
> 2. As RT creates a attachment drop transaction (since RT 4.2.7), is it
> still necessary to create a text attachment with the Content "Large
> attachment dropped" for dropped attachments ?
> The informations the text attachments make available are also available
> by the "attachment drop" transaction (date, user, filename, filesize)
> and thus are redundant (just to note that the transaction also shows the
I don’t have any insight into this one, but I’m open to getting rid of the old-style transaction if we can! It’s possible it was intentionally kept around to help preserve backwards compatibility with existing customizations.
> 3. Wouldn't it be better to check an uploaded attachment on
> Ticket/Create.html and Ticket/Update.html against the $MaxAttachmentSize
> and give the user an error message (which gives the user a chance to
> attach a smaller attachment) and abort the ticket create/update instead
> of creating or updating the ticket with a "attachment drop” transaction
Totally agreed. That would be a great improvement. :)
> 4. Maybe Ticket/Elements/AddAttachments should show a hint on the
> $MaxAttachmentSize (if set) to prevent users from try to upload
> attachments which are greater than $MaxAttachmentSize.
>  https://github.com/bestpractical/rt/blob/stable/lib/RT/Record.pm#L832
>  https://github.com/bestpractical/rt/blob/stable/lib/RT/Record.pm#L841
More information about the rt-devel