just better ergonomics and I don't think a lot of people will care
about the parts list, especially if the raw email is already visible
anyway.
Also note that while yes, the content-disposition is user
controllable, most (all?) MUAs only show it if set so even
spammers/attackers have it in their interest to set it.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Normally, attachments are given the 'content-disposition: attachment'
mime attribute, so we use that to filter the attachments.
But since we're dealing with spam & virus mails here, and that field
is client controlled, give the user a way to toggle the remaining parts
of the mail too.
Added the checkbox in the header part, but that made it necessary to
manually implement the expand/collapse toggle (since the tools are on
the wrong side of the default toggle)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
format_size is the "lower" level helper and is not fit (anymore) to
be set as renderer directly, as its parameter signature may clash
with the extra, different ones, that renderers get passed.
For example, the useSI param always gets evaluated as true due to
the metaData "truthy" value that calls to a renderer get passed along
most of the time.
Use the render_size instead, a wrapper which only passes along value
to format_size.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
A separate header and docked at the bottom reduces crowding at the
top and make the whole view(s) a bit clearer.
This also better mirrors where most mail clients show attachments
(e.g., thunderbird) and allows to avoid the extra button (UX benefits
most of the time from reduced inputs, if it doesn't takes away
features).
Make the panel collapsible for the spam and virus quarantine, and
hide the download button there; note that this isn't done for
security purpose but just wasn't requested and some users may do
better if they only decide deliver/delete here and let their MUA
handle attachements.
Disable collapsing in the Attachement quarantine, it doesn't really
makes sense there and we got a maxHeight already anyway.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
avoid overly repetition, we can still override them if we get a use
site that really requires different values here.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
So that admins can easily see which attachments exist for a mail,
without parsing the 'raw' mail content. Disable the download button
for these quarantines though, since it should not be necessary
to download the attachments for these.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
the Quarantine part is mostly copied from VirusQuarantine and adapted
the AttachmentGrid is inspired by the SpamScore list
this adds a new quarantine type 'Attachment' in the gui, where the admins
can review and control the mails in the attachment quarantine
it also shows a list of attachment/parts and a link where they can
be downloaded (in case the admin want to only forward a single
attachment or review the file in detail)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>