Re: [MlMt] Proposal: conditional image loading by URL filtering
Thanks! Cheers, -sam On 10 Nov 2017, at 9:53, Benny Kjær Nielsen wrote: On 7 Nov 2017, at 16:18, Sam Hathaway wrote: On 7 Nov 2017, at 8:00, Benny Kjær Nielsen wrote: That might work, but it would not be straightforward to implement. It would be easier to collect all remote URLs and provide them to the script in one go. That’d be fine too. Whatever’s easiest for you, really. And actually it doesn’t have to be a script, either. How about a plist file containing a list of rules? I agree that a plist might be better. I'll consider this. -- Benny ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate
Re: [MlMt] Proposal: conditional image loading by URL filtering
On 7 Nov 2017, at 16:18, Sam Hathaway wrote: On 7 Nov 2017, at 8:00, Benny Kjær Nielsen wrote: That might work, but it would not be straightforward to implement. It would be easier to collect all remote URLs and provide them to the script in one go. That’d be fine too. Whatever’s easiest for you, really. And actually it doesn’t have to be a script, either. How about a plist file containing a list of rules? I agree that a plist might be better. I'll consider this. -- Benny ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate
Re: [MlMt] Proposal: conditional image loading by URL filtering
On 7 Nov 2017, at 10:18, Sam Hathaway wrote: On 7 Nov 2017, at 8:00, Benny Kjær Nielsen wrote: On 6 Nov 2017, at 18:13, Sam Hathaway wrote: I was thinking you’d invoke the script once for each email, at display time. Does that change things for you? That might work, but it would not be straightforward to implement. It would be easier to collect all remote URLs and provide them to the script in one go. That’d be fine too. Whatever’s easiest for you, really. And actually it doesn’t have to be a script, either. How about a plist file containing a list of rules? Hey, that’s great. It means I’ll have to deal with a long, ugly regular expression, but I can tolerate that I think. I don’t think I need a deny pattern, since deny is MailMate’s default. Ok, I'll consider it resolved for now ;) Thanks again! -sam All nice sounding stuff, but please don’t slow down the entire app for things like this. I’m personally content to disable all remote resources, regardless of where they come from. v ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate
Re: [MlMt] Proposal: conditional image loading by URL filtering
On 7 Nov 2017, at 8:00, Benny Kjær Nielsen wrote: On 6 Nov 2017, at 18:13, Sam Hathaway wrote: I was thinking you’d invoke the script once for each email, at display time. Does that change things for you? That might work, but it would not be straightforward to implement. It would be easier to collect all remote URLs and provide them to the script in one go. That’d be fine too. Whatever’s easiest for you, really. And actually it doesn’t have to be a script, either. How about a plist file containing a list of rules? Hey, that’s great. It means I’ll have to deal with a long, ugly regular expression, but I can tolerate that I think. I don’t think I need a deny pattern, since deny is MailMate’s default. Ok, I'll consider it resolved for now ;) Thanks again! -sam ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate
Re: [MlMt] Proposal: conditional image loading by URL filtering
On 6 Nov 2017, at 5:13, Benny Kjær Nielsen wrote: Thanks for the detailed idea. Thanks for considering it! I'm thinking it might be a performance issue to call a script for every image (there can be a lot of them in a single email). I was thinking you’d invoke the script once for each email, at display time. Does that change things for you? The process on your side would look something like: ``` on display_html_email: proc = run(uri_approver) for image in remote_images: proc.write(image) result = proc.read() if result is 'allow': display(image) proc.end() ``` It might be nice with a more flexible solution, but if all you want is a regular expression to allow certain images then I already implemented `MmAllowedImageURLRegexp`. For example: defaults write com.freron.MailMate MmAllowedImageURLRegexp -string "https://(freron\.com|example\.com)/.*" Hmm, it appears I've “forgotten” to document this. Maybe because I didn't really finish this feature. I would have liked to also handle a `MmDisallowedImageURLRegexp`. Let me know if you need that. Hey, that’s great. It means I’ll have to deal with a long, ugly regular expression, but I can tolerate that I think. I don’t think I need a deny pattern, since deny is MailMate’s default. Thanks a lot! -sam ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate
Re: [MlMt] Proposal: conditional image loading by URL filtering
On 4 Nov 2017, at 17:10, Sam Hathaway wrote: I’ve been thinking about whether there’d be an easy way for you to add conditional domain-based image loading, without doing a bunch of UI work for a feature that (admittedly) has limited appeal. Thanks for the detailed idea. 2. If this is set, MailMate would run this program when displaying an HTML email. It would send the program each image URL on stdin, and expect to get back the strings `allow` or `deny`. I'm thinking it might be a performance issue to call a script for every image (there can be a lot of them in a single email). Everyone else could ignore this feature. What do you think? It might be nice with a more flexible solution, but if all you want is a regular expression to allow certain images then I already implemented `MmAllowedImageURLRegexp`. For example: defaults write com.freron.MailMate MmAllowedImageURLRegexp -string "https://(freron\.com|example\.com)/.*" Hmm, it appears I've “forgotten” to document this. Maybe because I didn't really finish this feature. I would have liked to also handle a `MmDisallowedImageURLRegexp`. Let me know if you need that. -- Benny ___ mailmate mailing list mailmate@lists.freron.com https://lists.freron.com/listinfo/mailmate