Closed tomscii closed 3 years ago
Spam score is already in.
Click on the large i
at the top of message to see it.
Currently there's also a hidden HTML Meter element in the messageview to show a meter from green to orange to red (33% step).
You can uncomment it and flush cache to see it in action.
I use Rspamd and SnappyMail handles it well. The meter is empty when message has negative float value (no spam at all).
Should it always show a SPAM score?
There is a score in the source of the message:
Thanks, I did not notice that the 'i' was clickable. That helps quite a bit. :)
But my point was that I would prefer to have a way for some things to jump out at the user looking at the email without them doing anything special. The way GMail puts in a warning if they think the email is a phishing/scam/virus-bearing message comes to mind. Partly for unsophisticated users who do not know/care about message headers, but also because all users (however sophisticated or familiar with looking at email headers they might be) would possibly benefit from a more direct/visible warning (e.g. before they click on a link or an attachment).
I'm not saying that there should always be a spam score shown up front, but I was thinking along the lines that the easiest (while fairly general) implementation would be to allow some match expressions to be configured which would pull in matching header lines into the immediately displayed information (even if the 'i' is unclicked), preferably with strong visual highlight to draw attention. The exact match expressions and highlight colors would be per-instance admin-configurable. Of course this is just my idea and there are probably better/other ways of doing something similar.
As I said, it's just an idea for your consideration. Thanks again! :)
I edited my previous comment. Did you check the link of the source i mentioned?
The commented out part with <meter...>
is what you looking for.
A few lines below that, you will see the other part that will only be visible when score is higher then 0.
And here the headers are detected: https://github.com/the-djmaze/snappymail/blob/master/snappymail/v/0.0.0/app/libraries/MailSo/Mail/Message.php#L444 (Rspamd, SpamAssassin and Bogosity)
I edited my previous comment. Did you check the link of the source i mentioned?
Yes, I should have mentioned that. Thanks!
For virus there are none yet. Will implement them ;)
Added X-Virus-Status detection.
When status is infected
it shows a red warning box.
When mail daemon is correctly configured, it should never show due to bounces.
This could be extended with:
null === hasVirus()
then 'this mail is not scanned for viruses'
and
false === hasVirus()
then 'this mail is scanned for viruses and non found'
This is not advised because there is never a guarantee that the message has none. For example GPG/PGP encrypted messages can't be scanned.
Thanks. I haven't tested this yet, but looking at the patch and reading your description I have a problem with it. I use rspamd and that puts an X-Virus: <name-of-virus>
header if a virus is detected. A cursory look at the documentation (https://rspamd.com/doc/modules/milter_headers.html#x-virus) does not reveal a way to enable an X-Virus-Status
header.
The mere presence of the X-Virus
header should be enough to flip the 'hasVirus' flag to true. Maybe it would be possible to add that?
Perfect, thanks a bunch!
Is your feature request related to a problem? Please describe. Not really a problem, but I thought it would be really cool if SnappyMail had the ability to warn the user about possibly dangerous or malicious email. Alternatively, help the user understand why the email has been put into Spam, etc. Please see this very unprofessional mockup to illustrate the concept:
Describe the solution you'd like The way I imagine this feature is that when certain headers exist or match a pattern, that header would be included in the message header area (below the subject with large bold letters, sender, date, recipient). Possibly (preferably) with a highlighted background.
So as a concrete example, I could somehow configure SnappyMail that "if the email has a header line that matches
X-Spam-Status: Yes ...
, then please put that header right up there on top of the message with a yellow background so I won't miss it. And if there is a header line that matchesX-Virus: ...
, put that up as well, with a bright red background."This mechanism would be completely independent of the folder (it would work just the same on all email everywhere), the mockup above shows an email in Spam, but it would be useful to see potentially dangerous emails dropped into the Inbox clearly marked as such (e.g., if the mail server is not configured to automatically move such email to a different place).
Describe alternatives you've considered GMail tries to do something similar by displaying vague text like "this message is in spam because it is similar to other messages already in there", which is not very technical. I think it's best to just display and highlight the given header, if there is a match, as is.
Additional context I guess this is something that would be best handled by an extension, to be enabled and set up site-wide by the SnappyMail administrator.