Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In the past I handled email filtering using's Rules. I want to move my filters out of and into another solution, such as a centrally-organized IMAP + procmail setup.

Is it possible to export apple rules for use with procmail?

If not for procmail per se, how about exporting to other formats that might be an easier intermediary between and procmail?

share|improve this question

You can find them in plist format (just an xml flavor) in:


You can write a script in the language of your choice to parse this file and produce rules suitable to procmail.

Here is a python draft:

#!/usr/bin/env python

import plistlib

pl = plistlib.readPlist('/Users/<user>/Library/Mail/V2/MailData/SyncedRules.plist')

for rule in pl:
    print ':0:'
    mbox = ''
    for key in rule:
        if key == 'Criteria':
            for c in rule[key]:
                print '^%s:.*%s' % (c['Header'], c['Expression'])
        if key == 'CopyToMailbox':
            mbox = rule[key]
    print mbox
share|improve this answer
I'm looking for more specifics, i.e. links to example scripts that do this, AND / OR for email apps that correctly import rules. – gosmond Oct 25 '13 at 3:55

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.