the-djmaze / snappymail

Simple, modern & fast web-based email client
https://snappymail.eu
GNU Affero General Public License v3.0
1.01k stars 122 forks source link

whitelist to show images directly #201

Closed yeupou closed 1 year ago

yeupou commented 2 years ago

Some mail clients allow to whitelist, on the fly, senders domains or senders addresses to show images directly, without requiring extra click.

HeyVern commented 2 years ago

+1

HeyVern commented 2 years ago

Any plans for this feature? It would be such a nice thing to have for WAF (wife acceptance factor)

the-djmaze commented 2 years ago

Any plans for this feature?

Yes, but on low priority. Why? Well mostly the remote images are from companies (signature or other) and not from private users.

Also, what should be whitelisted? Some companies don't use "companyname.tld" but use things like:

HeyVern commented 1 year ago

Just wondering, (answering your question above @the-djmaze ) but why wouldn't the from email address be what is whitelisted? If you trust the sender, then show whats in the email (like the button was clicked to do so).

the-djmaze commented 1 year ago

but why wouldn't the from email address be what is whitelisted?

And what if the from is noreply@gmail.com and then you whitelist gmail.com but the images are from https://xkcd.com/ ?

And what if the from is noreply@mailchimp and then you whitelist mailchimp but not company.tld?

Whitelists are never easy...

HeyVern commented 1 year ago

I would go one level higher than the domain and whitelist the actual 'from address' bob.thompson@gmail.com and then just simulate the button press for load external images, do not concern yourself of image source locations.

Don't get hung up on edge cases. I would put the responsibility for smart use (not whitelisting common from: email addresses like noreply@gmail.com) on the user. They can always delete a list entry if it is causing issues.

Most use cases are going to be things like orders@amazon.com, coupons@papajohns.com, etc. If another email came in from ads@amazon.com it would not be a match and subject to auto-external images screening.

I think a simple 'from email address' match is all that is really needed here, no need to over complicate it. It's an advanced option for advanced use.

the-djmaze commented 1 year ago

Ah you mean the full email address.

And should it have options like:

HeyVern commented 1 year ago

If a UI element was added to approve for external images in the future...you could capture the header combination present in the sampled email. So if the user presses the UI element (button) to whitelist...capture the sampled emails From header and Return-Path value and make the future rule match on both values. If you want to get that advanced about checking SPF/DKIM you could...but I honestly I think it's kind of overkill. The option of whitelisting should be an 'exception not the rule' kind of use.

The UI element could be a toggle. So that if a user wants to remove the exception, another click to toggle off would remove the corrisponding from and return-path match rule from the list.

yeupou commented 1 year ago

FairEmail does as follow when we ask to show images: warn that tracking images wont be shown; proposes to whitelist either the specific full email or the whole domain.

I found that convenient.

I like your idea to tie it to SPF/DKIM. Though a simple implementation (with warnings, and not applied to mails flagged as spam or inside the spam folder) would do fine, as it is supposed to be exceptional as pointed out by HeyVern. That should be secure enough (otherwise people should probably not even be using a web browser :) )

Regards,

thefrip commented 1 year ago

I agree with @yeupou that an implementation "a-la-FairEmail" (but Thunderbird or Roundcube do the same as well) would be super good. This linked with the address book makes it super simple to manage.

Rgds,

the-djmaze commented 1 year ago

linked with the address book

That is not possible for many buggy reasons. But a simple separate whitelist is doable.

the-djmaze commented 1 year ago

Added the whitelist setting. When active:

So you can make a whitelist as:

@mydomain.tld
remote.com

Where first only matches FROM and second both (FROM and URL).

From here we could finetune more options when needed.

HeyVern commented 1 year ago

@the-djmaze Initial post: Fantastic! Thank you.

Update: If I switch to "whitelist or ask" and place ANY value in the box, it appears to load all images regardless of match. Meaning if the textbox has ANY value at all. I tried even typing just the word 'test' and it globally whitelists all emails after that.

the-djmaze commented 1 year ago

If I switch to "whitelist or ask" and place ANY value in the box, it appears to load all images regardless of match.

Found the regex bug and fixed it.

HeyVern commented 1 year ago

@the-djmaze Thanks again for all your hard work. Just sent another donation via PayPal. Everyone should send a little something. This project is fantastic and development like this is not 'free' in that it takes someone's time. I know from personal experience it can be exhausting to only every hear of the problems and have high expectations for fixing it. OpenSource is a gift, give a little back to keep it going.

the-djmaze commented 1 year ago

@HeyVern thanks a lot!

thefrip commented 1 year ago

Works like a charm, thank you very much ! One more question, would it be possible to add a button "add to whitelist" next to the sender email address? This way the update of the whitelist would even be easier.

the-djmaze commented 1 year ago

@thefrip nice idea. Would a button aside of the "show images" that says "always show images of this sender" be a good location?

Issue: if setting is "always ask" it should not show this option or switch to the whitelist?

HeyVern commented 1 year ago

@thefrip nice idea. Would a button aside of the "show images" that says "always show images of this sender" be a good location?

Yes, in my opionion.

Issue: if setting is "always ask" it should not show this option or switch to the whitelist?

Not show the option. Also, you could keep the list in settings as you have it, just use the UI button to add/remove from the list.

HeyVern commented 1 year ago

@the-djmaze thanks for the update! The RegEx issue does seem to be fixed. Just a heads up, if using 'whitelist or ask' the 'ask' part doesn't seem to be working. If an email is not on the whitelist the UI element for manually showing the images seems to be gone.

the-djmaze commented 1 year ago

UI element for manually showing the images seems to be gone.

I noticed, also with mixed content where it did show image of domain.com but not from remoteimage.com

thefrip commented 1 year ago

Indeed I noticed the same, no more UI element to show the images. Sent from my mobile deviceLe 4 févr. 2023 à 15:52, the-djmaze @.***> a écrit :

UI element for manually showing the images seems to be gone.

I noticed, also with mixed content where it did show image of domain.com but not from remoteimage.com

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

ner00 commented 1 year ago

Added the whitelist setting. When active:

* If match with FROM whitelist all images

* Else if image url has match it is shown

So you can make a whitelist as:

@mydomain.tld
remote.com

Where first only matches FROM and second both (FROM and URL).

From here we could finetune more options when needed.

@the-djmaze This feature sounds nice, but as I was translating the strings for it I realized that it isn't self-explanatory at all, case in point: the discourse in the issue itself had different takes on the ideal implementation, also I had to come here and search for it to get context. I would assume that the same is true for the typical user. There should be a short description on how it works in the settings - structure, which delimiters to use, and so on.

Honestly, despite the explanation quoted above, it's still unclear to me how it should be formatted.

  1. Let's assume I trust Alice <alice@company.tld>, but not Bob <bob@company.tld>, whitelist is:

    alice@company.tld
  2. Let's assume I trust everyone at the company where Alice and Bob work at, whitelist is:

    @company.tld
  3. Let's assume I trust everyone at the company where Alice and Bob work at, and also www.microsoft.com (but NOT its sub-domains), whitelist is:

    @company.tld
    www.microsoft.com

I'm assuming that the delimiter is a new line, unlike the domain user's whitelist (which uses spaces, so this inconsistency should be closed by harmonizing the delimiter in any given whitelist).

Which assumptions above are correct or incorrect?

the-djmaze commented 1 year ago

I'm assuming that the delimiter is a new line

It can be: space, new line, comma, ; or : Domain whitelist has same behavior.

ner00 commented 1 year ago

I'm assuming that the delimiter is a new line

It can be: space, new line, comma, ; or : Domain whitelist has same behavior.

Ok, thanks for clarifying that. It does indeed need some description in the settings to convey this information, along with the accepted format, the prefixes and the filtering rule in general (from address, image url).

As for the image url, it's still unclear to me how the regex captures the whitelisted domain. Does microsoft.com include any subdomain (ex: apps.microsoft.com), or is it strict? If it is strict, can you use a wildcard for subdomains?

the-djmaze commented 1 year ago

It's not strict. It even allows things like https://images.com/microsoft.com.png

ner00 commented 1 year ago

It's not strict. It even allows things like https://images.com/microsoft.com.png

So, as it stands, would it be possible to enforce a base domain with something like //microsoft.com?

the-djmaze commented 1 year ago

yes, that is possible

HeyVern commented 1 year ago

@the-djmaze 2.25.4 whitelist is working for me. 👍

yeupou commented 1 year ago

This whitelist is very cool. It would be even better direct shortcuts where there is free room:

image

as in

image

it does not need to be a menu, but something like [icon : add sender to whitelist] [icon : add domain to whitelist] (thunderbird also propose to add URLs but it gets hairy)

thefrip commented 1 year ago

Indeed this is the idea: not a menu, icon shortcuts as there is already space for that and more convenient than a menu (one click action instead of two).

6 février 2023 à 21:53 "Mathieu Roy" @.***> a écrit:

This whitelist is very cool. It would be even better direct shortcuts where there is free room:

as in

it does not need to be a menu, but something like [icon : add sender to whitelist] [icon : add domain to whitelist] (thunderbird also propose to add URLs but it gets hairy)

— Reply to this email directly, view it on GitHub https://github.com/the-djmaze/snappymail/issues/201#issuecomment-1419734319 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AAUSPT2QSHOQAOJ2TWJFUHTWWFQFPANCNFSM5NDJLU5Q . You are receiving this because you were mentioned.

the-djmaze commented 1 year ago

When there's no menu, i now have this: afbeelding

thefrip commented 1 year ago

Hum, I was thinking of only one button to keep it simple, something like "Allow images from this sender" which would push the sender email address to the whitelist. For other cases (like per domain, etc.), user could manually update the whilelist. Otherwise the button list might grow too much. Or then we could go for the menu option. What do you think?

the-djmaze commented 1 year ago

The menu option would be the best approach. As you can see, you might want to allow a0.muscache.com but not tracking.airbnbmail.com. Else when you (accidentally) allow the sender, all images are whitelisted :wink:

the-djmaze commented 1 year ago

afbeelding

thefrip commented 1 year ago

Fair enough, this might be the way indeed. At the very least the menu approach shows all what would be whitelisted (this may need a bit of an explanation though as otherwise people may get confused when they see the list, what do you think?).

End of the day it is only one more click :-)

yeupou commented 1 year ago

Looks very good. And since it is whitelisting, we can expect this one extra click not to happen too often as soon as the whitelist is filled.

the-djmaze commented 1 year ago

Should email address be the first or last?

ner00 commented 1 year ago

Thumbs up for first, thumbs down for last.

thefrip commented 1 year ago

I would say first

thefrip commented 1 year ago

I just upgraded to the new version (using it through nextcloud, so a bit of a delay), it is awesome. Only think I would suggest in terms of usability would be to add some space between the two buttons ("show images" and "whitelist") as on my screen they are stuck together, almost as if it were only one button.