Export Outlook Rules to Gmail Filters

I live in Outlook, I know its terribly unfashionable in the age of thin clients and the cloud but I just can’t give it up, for what I need it just works. I recently wrote this small tool to help me export rules that I define in outlook so that I can import them into Gmail as filters and have then run on the server rather than on the client. You can grab the code from GitHub by clicking here (Code) or download it below.

UPDATE – 9/7/2013
– Version 0.0.2 is current stable version
– 1500+ downloads on GitHub – Thank you.
– Added support for some new rule types see GitHub


0.0.2 – supports more rule types (Stable version)
0.0.1 – only supports from move-to-folder rules

– See instructions here http://bcleary.github.com/outlook-gmail-rules-export/

26 thoughts on “Export Outlook Rules to Gmail Filters

  1. Bob Rae says:

    Excellent! Thank you so much!

  2. Tidhar Mor says:

    Great tool, thanks.
    I just found a small bug though: if the rule has several email addresses in the From field, only one of them is added to the gmail filter.

  3. JS says:

    This is exactly what I was looking for, but I keep getting error. I am running on Windows 7 Enterprise.

  4. christophe says:

    hello bcleary.

    coudl you please let me know how I am to export my outlook rules? I ran your code, but I’m not sure what to do next!

    thanks a lot!

  5. Jay says:

    I got:
    Unhandled Exception: System.MissingMethodException: Method not found: ‘System.Ty
    pe System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)’.
    at OutlookRulesExport.Program.GetStore(String storeName)
    at OutlookRulesExport.Program.Main(String[] args)

    any thoughts? Windows 7, Outlook 2003

  6. MauiSpud says:

    Perfect – worked well. Mahalo

  7. MrMartyMac says:

    Thank you for this tool, but I wonder if you would consider adding rule type “With specific words in senders address”? That is what almost all of my rules are based on.

    • bcleary says:

      @MrMartyMac can you give me an example of the type of rule you are talking about? Is it something like you have a sender address like “xxQueryStringxxx@xxx.com” which you want to match with “QueryString”?

  8. San says:

    I’m using Google App Sync for Outlook 2007, when I use OutlookRulesExport.exe -s … it gives me list of mailbox (Google Apps – abc@xyz.com), but when I try OutlookRulesExport.exe Google Apps – abc@xyz.com, it says ‘No such mailBox’ … I try OutlookRulesExport.exe abc@xyz.com, but still same, you know any workaround with Google Apps

    • bcleary says:

      Hi San,

      I have not used this against a Google Apps account before but first try putting quotes around the full mailbox name. E.g. OutlookRulesExport.exe “Google Apps – abc@xyz.com

      • San says:

        Thanks for prompt reply, I tried both double and single quotes, but get same ‘No such mailbox’ … I don’t have much rules set-up, but still hate to re-write at Gmail … Thanks

      • bcleary says:

        It could be something to do with the type of mailbox the Google sync app is creating. I thought it was just creating a normal mailbox but it could be doing something a little more strange. I don’t have Google Apps set-up right now to debug it. A workaround might be to export the rules from the google apps mailbox in outlook as a rwz file and re-import them into a new “standard” mailbox. Not sure where this option is in Outlook 2007 but in Outlook 2013 its in the Rules and Alerts dialog under Options -> Export.

  9. San says:

    Outlook 2007 also have same option, but as I said, I didn’t have much rule set-up, so last night updated manually at GMail (I just wanted to try this great tool, may be some time later), Thanks again,

  10. Kyle says:

    I’m trying to run on windows7 64 bit and office 2013 and getting the following error.

    C:\Program Files\Microsoft Office\Office15>OutlookRulesExport.exe -s

    Unhandled Exception: System.MissingMethodException: Method not found: ‘System.Ty
    pe System.Runtime.InteropServices.Marshal.GetTypeFromCLSID(System.Guid)’.
    at OutlookRulesExport.Program.GetStores()
    at OutlookRulesExport.Program.Main(String[] args)

  11. This has been a great time-saver for me, so I just thought I’d pop by and say thanks.

    So… thanks!

  12. HM says:

    I need this in reverse … I want to export my rules FROM gmail TO outlook. Can anyone point me in that direction? Just beginning to research so I may find an answer, but if you have a tip it would be greatly appreciated! Thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: