Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

whitelist to show images directly #201

Closed
yeupou opened this issue Jan 29, 2022 · 41 comments
Closed

whitelist to show images directly #201

yeupou opened this issue Jan 29, 2022 · 41 comments
Labels
enhancement New feature or request

Comments

@yeupou
Copy link

yeupou commented Jan 29, 2022

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

@yeupou yeupou changed the title whitelist to show images whitelist to show images directly Jan 29, 2022
@the-djmaze the-djmaze added the enhancement New feature or request label Feb 4, 2022
@HeyVern
Copy link

HeyVern commented Jun 15, 2022

+1

@HeyVern
Copy link

HeyVern commented Aug 13, 2022

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

@the-djmaze
Copy link
Owner

the-djmaze commented Oct 17, 2022

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:

  • mandrill.com/track/click/
  • tracking.companyname.tld/track/click/
  • mccontent.com/companyname/tracking/image.png

@HeyVern
Copy link

HeyVern commented Nov 17, 2022

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
Copy link
Owner

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
Copy link

HeyVern commented Nov 17, 2022

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
Copy link
Owner

Ah you mean the full email address.

And should it have options like:

  • From header must match Return-Path header?
  • SPF/DKIM must be valid so that spammers impersonating get denied?

@HeyVern
Copy link

HeyVern commented Nov 18, 2022

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
Copy link
Author

yeupou commented Jan 13, 2023

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
Copy link

thefrip commented Jan 16, 2023

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
Copy link
Owner

linked with the address book

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

@the-djmaze
Copy link
Owner

the-djmaze commented Jan 31, 2023

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.

@HeyVern
Copy link

HeyVern commented Feb 3, 2023

@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 pushed a commit that referenced this issue Feb 3, 2023
@the-djmaze
Copy link
Owner

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
Copy link

HeyVern commented Feb 3, 2023

@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
Copy link
Owner

@HeyVern thanks a lot!

@thefrip
Copy link

thefrip commented Feb 3, 2023

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
Copy link
Owner

the-djmaze commented Feb 3, 2023

@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
Copy link

HeyVern commented Feb 3, 2023

@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
Copy link

HeyVern commented Feb 4, 2023

@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
Copy link
Owner

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
Copy link

thefrip commented Feb 4, 2023 via email

@ner00
Copy link

ner00 commented Feb 6, 2023

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
  1. Let's assume I trust everyone at the company where Alice and Bob work at, whitelist is:
@company.tld
  1. 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
Copy link
Owner

the-djmaze commented Feb 6, 2023

I'm assuming that the delimiter is a new line

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

@ner00
Copy link

ner00 commented Feb 6, 2023

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
Copy link
Owner

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

@ner00
Copy link

ner00 commented Feb 6, 2023

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
Copy link
Owner

yes, that is possible

@HeyVern
Copy link

HeyVern commented Feb 6, 2023

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

@yeupou
Copy link
Author

yeupou commented Feb 6, 2023

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
Copy link

thefrip commented Feb 7, 2023 via email

@the-djmaze
Copy link
Owner

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

@thefrip
Copy link

thefrip commented Feb 7, 2023

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
Copy link
Owner

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 😉

@the-djmaze
Copy link
Owner

afbeelding

the-djmaze pushed a commit that referenced this issue Feb 7, 2023
@thefrip
Copy link

thefrip commented Feb 7, 2023

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
Copy link
Author

yeupou commented Feb 7, 2023

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
Copy link
Owner

Should email address be the first or last?

@ner00
Copy link

ner00 commented Feb 8, 2023

Thumbs up for first, thumbs down for last.

the-djmaze pushed a commit that referenced this issue Feb 8, 2023
* sort options based on domain count (highest top)
* hide when whitelist not active
@thefrip
Copy link

thefrip commented Feb 8, 2023

I would say first

@thefrip
Copy link

thefrip commented Feb 9, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants