Anti-Spam

I like Apple Mail for Mac OS X, but one thing that irritates me to no end is that the Load Images button, which loads the images in a message on-demand, doesn’t have a keyboard shortcut. Because it’s not a menu item, there’s no easy way to add one. I looked for a way to add a keystroke to Load Images for more than five years before I finally found a way to do it.

The hard part is triggering the Load Images button itself, by anything besides a mouse click. What finally did it was using the GUI Scripting feature of AppleScript to tell the button to click itself. Once I had an AppleScript that worked, it was simple to use FastScripts to trigger the script with a keyboard shortcut.

Why don’t I let Mail load images automatically? Spammers use image loading to confirm the validity of an email address. See this Apple Support Forum post for some details, and how to turn it off.

AppleScript to Load Images in Apple Mail

Download the Load Images script v1.4.1, 2013-11-24

The work of the script can be done by a single line that might look like this:

click button "Load Images" of 
    UI element 1 of row 1 of table 1 of scroll area 1 of front window

(Because Mail.app’s user interface has changed across various versions, and with different preference settings, the actual code is more complex. See the AppleScript for the full, ugly details.)

This user interface elements path, or specifier, tells the GUI Scripting system how to reach a specific user interface element, in this case a button, and what to do with it. It’s far from obvious how to determine one of these UI specifiers just by looking at a Mail window; I used the very interesting developer tool UI Browser to figure it out.

It’s also specific enough to be brittle; it has changed from prior versions of Apple Mail, and will probably change in the future. When it does this script will stop working and start beeping. I’ve written the script to adapt to a few different version and configuration possibilities, and I’ll try to update it if it ever breaks. The current version (v1.4) is compatible with Mac OS X 10.5 (“Tiger”) through Mac OS X 10.9 (“Mavericks”).

The rest of the script is error handling and AppleScript ceremony. It should make sense if you’re familiar with AppleScript, and there are plenty of comments, so I won’t describe it here.

Add a Keyboard Shortcut for Running the AppleScript

Adding a keyboard shortcut for an already-existing menu item is easily done using the Keyboard preference pane. Adding a keyboard shortcut for an AppleScript requires a third-party utility. You may already have a favorite—there are lots to choose from—and so do I. FastScripts from Red Sweater Software does a great job handling application-specific AppleScripts, and it’s free if you don’t need more than 10 keyboard shortcuts. (It’s also a good value at $14.95 for the unlimited version.)

Create the shortcut for the AppleScript

  1. Install and run FastScripts, and then switch to Mail.app.
  2. From the FastScripts menu, choose Open Mail Scripts folder. Open Mail Scripts folder menu item
  3. Move or copy the Load Images script into the Mail Scripts folder.
  4. From the FastScripts menu, choose Preferences…, click the Script Shortcuts tab, and add your preferred keyboard shortcut. Keyboard shortcut for Load Images AppleScript

Note: If you use the same keyboard shortcut I did, Command-Shift-L, you’ll need to change the keyboard shortcut for the existing menu command that uses it, by adding a new one to that command, using the technique at the Mactuts+ article linked above.

{ 15 comments }

Corpus reset

by Michael Alderete on 4/26/2005 · 0 comments

SpamSieve, by far the best anti-spam email tool I’ve used, was updated to version 2.3 yesterday. The biggest change listed was increased accuracy, due to improvements in the tokenizers and parsers. John Gruber reported that the beta versions were running at 99.9% accuracy for him, which is several tenths of a percent above where I’d peaked.

When you get more than one thousand spams a week, you live for improvements of a couple of tenths of a percent. I of course upgraded immediately.

Read the rest of this entry (281 words) »

{ 0 comments }

Anti-virus for Mozilla Thunderbird?

by Michael Alderete on 3/15/2005 · 19 comments

For many years, Rochelle used Netscape Communicator for her email. About a year and a half ago, I switched her to Mozilla Thunderbird, which is the code and user-interface successor to Communicator. For the most part it works very well, but it has one astonishing omission: its anti-virus capabilities are terrible.

This is all the more remarkable given their tagline (“Reclaim Your Inbox”), and the second sentence of their Why Use Thunderbird blurb: “We designed Thunderbird to prevent viruses and to stop junk mail so you can get back to reading your mail.” Thunderbird is positioned as the more user-centric, safer alternative to Microsoft Outlook.

Read the rest of this entry (579 words) »

{ Comments on this entry are closed }

Comment form fakeout

by Michael Alderete on 3/13/2005 · 4 comments

When I converted this site to WordPress, I decided to turn on commenting, and see what happened. I have gotten a fair number of really good comments, and from people I didn’t know, which was cool. I also got a ton of comment spam (most of which never made it online). Not cool.

So I did a few things about it.

Read the rest of this entry (213 words) »

{ 4 comments }

Spam counts for 2004

by Michael Alderete on 2/22/2005 · 0 comments

2004 was a big year for spam, after Congress voted to make it legal at the end of 2003. The result: spam increased sharply in 2004.

But in my own, more personal battles with spam I’ve been more successful at holding back the tide. My stats for 2004:

Filtered Mail
36278 Good Messages
72239 Spam Messages (67%)
197 Spam Messages Per Day

SpamSieve Accuracy
135 False Positives
451 False Negatives (77%)
99.5% Correct

Nearly seventy five thousand spam messages came at me, but thanks to SpamSieve a mere 451 made it into my Inbox. That’s less than two spams a day. Simply amazing.

Read the rest of this entry (226 words) »

{ 0 comments }

How this weblog is run

by Michael Alderete on 1/16/2005 · 2 comments

As I have been working on this site, I’ve visited quite a few other weblogs run by WordPress, and occasionally see something that I’d like to know how to do myself. A little widget here, a list of related posts there, a cool show/hide trick somewhere, etc. Cool things, but nothing that says how to do them. So, if anyone ever has that thought about my site, here’s the info. (This is really of interest to WordPress users only, but hopefully it’ll be useful, and other WordPress users will do the same.)

Read the rest of this entry (689 words) »

{ Comments on this entry are closed }

Done digging for a while

by Michael Alderete on 1/8/2005 · 0 comments

I spent a couple of hours yesterday working on a few last lingering details for this site. The main changes I wanted to make were to upgrade to the latest version of WordPress (a minor security update), make sure I was using the latest version of the Kubrick template (I was), and most importantly, fix the problems I was having with the Kubrick comments form, which is a lot cleaner and nicer than the standard WordPress version.

Read the rest of this entry (308 words) »

{ 0 comments }

Personal survey of anti-spam tools

by Michael Alderete on 1/7/2005 · 12 comments

In the three or four years I’ve been fighting unwanted e-mail messages with better tools than the Delete key I’ve tried almost a dozen different tools. This is a quick (ha!) survey of the ones I’ve used, and why I don’t (or do) still use them.

My very first anti-spam tool was something called Mailfilter. I used it for my personal e-mail on Mac OS X, wrote about it here, and almost immediately afterwards lost a non-spam message to an aggressive keyword match. That was the end of Mailfilter. I can’t even remotely recommend it, as it’s just not intelligent enough (strict, single expression matching), and had zero safety net.

My next attempt at a solution was a utility called SpamFire. Like Mailfilter, it is a “pre-filter,” which means it would run before my e-mail client, download my mail, and skim out the spam. Unlike Mailfilter, it actually saved the trapped messages, so if it made a mistake, I could recover the message. It had plenty of other differences from Mailfilter, which I wrote about previously, and which made it so useful that it became the first anti-spam tool I paid for. But in the end I switched to a different tool because SpamFire was separate from my e-mail client, and that made it cumbersome to use.

Read the rest of this entry (2,185 words) »

{ Comments on this entry are closed }

Spam counts for Q2

July 1, 2004

So, with the end of the first half of the year, I thought break my silence by taking another look at the level of spam flowing into my mailboxes, and how well my tools are coping with it.

Read the full article →

Spam count so far this year

March 29, 2004

With Q1-2004 coming to a close, I thought I’d take a look at my spam situation, which has been escalating out of control. Since 12:01am January 1, 2004 I have received 22,255 spam messages via e-mail. That’s more than 250 a day, every day, for the last 89 days. Earlier in the year, the daily average was lower, which means that in the last couple weeks it’s gone well above 250 per day. In spite of these numbers, I have two things that give me hope.

Read the full article →

Save me from the bounces!

January 31, 2004

I have over the last two years implemented, I think, a dozen different anti-spam technologies to protect my Inbox. (I’ll total them up and summarize my thoughts in another post.) Today I finished implemented yet another, called SPF, or Sender Permitted From.

Read the full article →

Eudora 6 with SpamWatch

September 10, 2003

QUALCOMM’s Eudora has been my e-mail client of choice for nearly 10 years, and last week a major new version shipped, Eudora 6. My primary concern before upgrading was whether and how my other anti-spam tool, Spamnix, would work with the new version, especially with the new SpamWatch feature. I’m thrilled to report that Spamnix works fine with Eudora 6 (for Mac OS X), and that Spamnix + SpamWatch is more effective than either tool alone.

Read the full article →