<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/xhtml; charset=utf-8">
</head>
<body>
<div style="font-family:sans-serif"><div style="white-space:normal">
<p dir="auto">On 6 Nov 2017, at 5:13, Benny Kjær Nielsen wrote:</p>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">Thanks for the detailed idea.</p>
</blockquote>

<p dir="auto">Thanks for considering it!</p>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">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).</p>
</blockquote>

<p dir="auto">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:</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">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()
</code></pre>

<blockquote style="border-left:2px solid #777; color:#777; margin:0 0 5px; padding-left:5px">
<p dir="auto">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 <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">MmAllowedImageURLRegexp</code>. For example:</p>

<pre style="background-color:#F7F7F7; border-radius:5px 5px 5px 5px; margin-left:15px; margin-right:15px; max-width:90vw; overflow-x:auto; padding:5px" bgcolor="#F7F7F7"><code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0" bgcolor="#F7F7F7">defaults write com.freron.MailMate MmAllowedImageURLRegexp -string "https://(freron\.com|example\.com)/.*"
</code></pre>

<p dir="auto">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 <code style="background-color:#F7F7F7; border-radius:3px; margin:0; padding:0 0.4em" bgcolor="#F7F7F7">MmDisallowedImageURLRegexp</code>. Let me know if you need that.</p>
</blockquote>

<p dir="auto">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.</p>

<p dir="auto">Thanks a lot!<br>
-sam</p>
</div>
</div>
</body>
</html>