this allows toggling the presentation of the email previews depending
on the current theme. in the default "light" mode the toggle is hidden
to avoid clutter. enable the toggle in other themes to allow switching
back to the original way the email was rendered.
this requires a bump of the widget toolkit. the toolkit provides the
styles necessary for the toggle to work.
Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
So that users can filter these quarantine views, e.g. useful if they
have many mails there.
Replaced the emailSelection config with a quarantineType configs
since we want to have different behaviour for different quaratine
types. E.g., we want to show 'all' mails by default for the
virus/attachment quarantine, but not for the spam one.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
arguments needs to be an array, often we call with all of ours, iow.
using `arguments` which itself is an array already.
Both, manual construction and just a passing `arguments` have their
advantage and disadvantage, e.g., if either the inheriting or
bequesting class becomes more specialized, but most of the time using
`arguments` is more future proof.
Fixes: e66c888 ("quarantine: refactor spamquarantine controller")
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>
one cannot set the different borders seperately in panels/grids and
docked items don't have a bottom border in extjs, but we want to remove
all borders except the ones between the toolbar and the grids/content
below that.
to achieve that, set a custom 'border-bottom-width' with '!important'
(extjs has a rule with !important as well) for the toolbar, and
everywhere else remove the border.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
By making use of the optional chaining operator, we don't need to
override the 'onSelectMail' in both the attachment quarantine and the
spam quarantine. Instead, we opportunistically call lookup(id)?.setID
in the common handler for both, the attachments and the spaminfo
references.
As that was the single change from the parent class we can now drop
the specialized controller classes.
While at it, remove the stray 'xtype' property of the quarantine
controller, which make only sense for component derived classes.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
[T: fix typos and reword message a bit]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
over the time the spam quarantine has gained quite a few nice
usability improvments and features, which would be useful in
the virus and attachment quarantines as well - e.g.:
* multi-mail selection
* keyboard actions
* context menu
* download mail as .eml
this patch splits the controller part into a file of its own, while changing
'var' to 'let' and removing the parts only relevant for the spamquarantine
and adapts the current SpamQuarantine.js to use it.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
In some languages, e.g. widely used English, "Delete" and "Deliver"
are looking rather similar without too much eye squinting required.
Add an accent on their icons using for, at least in the western
hemisphere, the respective associated color, like red for trash can.
To 1) avoid to much messing with those cultures that got it switched
and 2) some more common color blindness use blue for the delivery
button, just to make it stand out.
Keep the white/black list as is, as such accents work best if not
everything uses them, i.e., so that they more common options actually
stand out.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
extends on the improvements from the previous commit, reduces code
lines while (hopefully, as slightly subjective) not reducing
readability
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
in extjs 7.0 the css changed slightly so that we need to define
the 'fit' layout explicitely to maintain the full width/height
otherwise it can happen that the iframe gets cut off
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this patch adds the cleanup for the attachment quarantine from
0e26e20aa5 to the virus- and
spamquarantine.
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
This fixes a UX regression stemming from the recently introduced
commit 9aed379a70
"spam quarantine: avoid full store reload on single-element actions"
A load restored the saved selection after load complete, with the
neat and very useful feature to jump to the next in line if the old
one did not exist anymore.
Call this now factored out code part ourself in the fast-path.
This was reported in the forum:
https://forum.proxmox.com/threads/proxmox-mail-gateway-6-4-released.86760/#post-380971
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
A store load may require several seconds to complete, which can get
frustrating fast.
For single actions we have a callback which gets only executed on a
successful API call, so we can just remove the entry there directly
from the in-memory store.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
With ~20 bytes per message-id and separator we get over the current
HTTP post size limit of 64 KiB with ~ 3200 messages.
As 2500 is a relatively nice number for humans to deal with rather go
for that one, that leaves also some room for potential longer IDs in
the future.
Send the batches of async in pairs, as with that the pmgproxy can
still cope well and is not overloaded.
Mask the whole list panel with a 'Processing...' loading-mask during
sending of requests affecting multiple messages, so that the user
gets some instant visible feedback that something is actually
happening (the api calls may return only after a few seconds).
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Mostly taken from a bigger patch of Dominik, for now lets just show
the count (release is near) and add some padding
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
We did already hide it when toggling raw/html, but when choosing raw
and changing the mail, it was again set to visible.
This patch fixes that by always taking 'me.raw' into account.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
on deleting the last mail in the list, the selection is empty and
the access below to 'rec.data.id' breaks, leaving the maillist broken
(until the user changed the panel or reloaded)
so give rec an empty fallback object and check if there is a 'data'
property and use that, otherwise set the id to the empty string
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
This avoids all the strange click event hack. We already have a
button where the users needs to click on, so just use that.
A viewModel with a downloadMailURL formula to assemble the href
allows us to just bind the "href" config from the Download button,
and be done with it..
refactors commit 7ad0de10d6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
since datauri downloads are size limited (2MB in chrome), we have
to use another method, and instead of working around in the gui
(e.g. by using URL.createObjectURL) make use of the existing download
code in the api, which should have better compatibility
(and omits the whole raw -> json -> raw -> base64 conversion chain from
file to download)
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-By: Stoiko Ivanov <s.ivanov@proxmox.com>
Reviewed-By: Stoiko Ivanov <s.ivanov@proxmox.com>
d/D: deliver
delete: delete
w/W: whitelist
b/B: blacklist
the delete key registers differently depending on browser,
so we have to check for event.DELETE and '127'
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
this changes the SpamQuarantine so it uses the refactored version
of the list, and add the function to show the spaminfo
in a table
also it changes from "show html"/"show raw" buttons to
a single button which gets toggled
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>