All-Rules Mail Bundle: The shortcut to your rules

Have you ever wanted to automate some message sorting tasks in Apple’s Mail application after you have read a message? I, for example, use one archive folder per account and move all messages into that folder after I’ve read them. The application’s rule system is perfectly suited for that task, unfortunately there is no way to activate certain rules by pressing a keyboard shortcut. That’s where this bundle comes into play.

The All-Rules Mail Bundle acts as a plugin for Apple’s Mail application and serves just one specific purpose. It provides an additional menu item located under “Message -> Apply All Rules” which applies all active rules to the currently selected messages while ignoring any present “Stop evaluating rules” action.

Where to get the bundle

The source of the bundle is available at GitHub as a standard Xcode project. Feel free to adapt it to your needs if necessary. I will also provide a precompiled binary for those of you who just want to use it out of the box.

Note that I’ve developed and tested the thing on my only Mac machine, which clearly is an inadequate test coverage. As always I would be happy about any response. So far the bundle is known to run in the following environment, which is the most recent one at the time of writing.

  • Mac OS X Snow Leopard 10.6.6
  • Mail Application 4.4
  • Message Framework 4.4

How it is implemented

First of all, let me emphasis that this is the first time I actually did some Objective-C coding. But I really liked the feel of it. I was really surprised about the power of the Objective-C runtime. You can do lots of nasty stuff at runtime like changing class hierarchies, adding methods to classes, changing method implementations and so on.

I used one technique known as method swizzling in the bundle, which lets you switch the existing implementation of a method with your own replacement at runtime. This enabled me to override the original shouldStopEvaluatingRules implementation of the MessageRule class inside the Message framework.

Unfortunately most of the APIs of the Mail application and the Message framework are private, so I expect my bundle to break sometime in the future. But the API can be easily reverse engineered with the class-dump utility which generates header files out of Objective-C binaries.

To prevent bundles from silently breaking, each bundle includes a list of the exact versions of Message frameworks and Mail applications it is compatible with. I found an article that explains how to fix unsupported plugins after upgrading without recompiling them. So if you have different versions running on your machine that are compatible as well, let me know about them.

And last but not least I want to mention one article which helped me a lot in figuring out all those tiny details and really did it’s job in demystifying plugins on Leopard for me.

Related bundles

The same (and more) could be done with Indev’s Mail Act-On bundle, unfortunately that bundle is sold under a commercial license. With my bundle I cloned the essential feature which was indispensable for my personal use.

Whenever it is in any way

Whenever it is in any way possible, every boy and girl should choose as his life work some occupation which he should like to do anyhow, even if he did not need the money.

Everything is become

Everything is become automated aand simple with this hack

Please let me know if you're

Please let me know if you're looking for a author for your blog.
You have some really great articles and I feel I would be a good asset.

If you ever want to take some of the load off, I'd absolutely
love to write some material for your blog in exchange for a link back to mine.
Please blast me an e-mail if interested. Kudos!

Boldness in itself is genius.

Boldness in itself is genius.

Les supporters d'un jeu se

Les supporters d'un jeu se tiennent au courant concernant tout en ce qqui
leyr jjeu favori.

Thanks for finally talking

Thanks for finally talking about >Reply to comment | <Loved it!

Great article! We will be

Great article! We will be linking to this great article on our website.

Keep up the great writing.

Yoou ought too be a part of a

Yoou ought too be a part of a contest for one of the best websites on the web.
I'm going to highly recommend this blog!

It's remarkable to go to see

It's remarkable to go to see this web site and reading the views of
all mates concerning this piece of writing, while I am
also eager of getting familiarity.

Wow! Finally I got a blog

Wow! Finally I got a blog from where I know how
to truly get useful information regarding my study and

Wonderful website you have

Wonderful website you have here but I was wondering if you
knew of any discussion boards that cover the same topics discussed in this article?
I'd really love to be a part of online community where I can get comments
from other experienced individuals that share the same interest.

If you have any recommendations, please let me know. Thanks a lot!

I like to see a post on your

I like to see a post on your own website, it can help to raise the atmosphere I'm annoyed with this timeI really like your website discussion to this one, really inspire and very strange.

crystal x product is actually

crystal x product is actually not dangerous because it has megantongi permission from bpom and mui. If used in the right way as if the stipulated set of this product will have a positive effect on the user, but if the wrong way of using this product could have an adverse effect

I am really thankful to the

I am really thankful to the holder of this web page who has shared this great paragraph at

Hurrah! Finally I got a

Hurrah! Finally I got a website from where I be capable of genuinely obtain valuable facts regarding my study and knowledge.

At this time it appears like

At this time it appears like Expression Engine is the preferred blogging platform available right
now. (from what I've read) Is that what you're using on your

Hi Michael, Bit off topic but

Hi Michael,
Bit off topic but thanks for the firefox addon. The new version works great. All other ones break now because there they don't have a results per page value which yours does.


When individuals Purchase

When individuals Purchase Mixtapes all they've to complete
would be to click the "Download" button and also the music will probably be automatically downloaded to your personal pc, laptop or any other music device.
Like being able to understand sequencing, counting bars,
knowing song structure and things of that nature.
And now pop singer are enlisting rap stars to be featured on many radio hit songs.

At the store, train kids to

At the store, train kids to take a look at meals labels to start understanding what to look for.

Are you attempted chatting

Are you attempted chatting with someone and also he or she suddenly turned his or her face from you?
What would involve your mind then? You may think that she
doesn't like you? Or, she doesn't wish to see your
face? Or, is it because your breath is nasty? Well, the last that I stated
is the most awful. Having a halitosis or bad breath is
frustrating and also awkward. It ruins our socializing and also our communication with people.
Baseding on research, bad breath is triggered by the kinds of food that we consume, inadequate oral hygiene, gum illness,
and digestive system diseases. Brushing our teeth often could remove bad bacteria that
have an odor in our mouth nevertheless; did you know that brushing your teeth isn't really sufficient?
Our tongue - yes our tongue is also the major
resource of halitosis or bad breath since it resembles
a carpet where the decayed foods are stuck.

Nice replies in return of

Nice replies in return of this matter with real arguments and explaining everything
regarding that.

I blog frequently and I

I blog frequently and I really thank you for your information. This great article has truly
peaked my interest. I will bookmark your website and keep checking for
new details about once a week. I opted in for your RSS feed as well.

I don't even know the way I

I don't even know the way I stopped up right here, but I assumed this put up
was once good. I don't know who you're but certainly you are going to a well-known blogger in the event you are
not already. Cheers!