1. Welcome to the new MacRumors forums. See our announcement and read our FAQ

Mac Mail Rule: Matching sender to a text file list

Discussion in 'Mac Applications and Mac App Store' started by st.len, Nov 9, 2012.

  1. macrumors newbie

    The short: I'm looking for a solution that will allow me to flag mail messages based on the from: field by matching them with addresses in a text file (NOT address book)

    The long: I'm a college coach. I'm inundated with hundreds of emails a week from potential recruits. The vast majority of these aren't legit, but those that are are very important that I reply to asap. I'm trying to find a solution where I can whitelist a certain set of email addresses so that they are highlighted in my mailbox so that I can respond to them quickly. While this can be accomplished easily enough using mail rules and whether they are located in my address book, I would need to add hundreds of contacts to my address book - contacts that serve no purpose other than being "whitelisted".

    An alternate solution would be to add them individually under a rule in mac mail (and this may be the route I go). While this would save me from having too many cards in address book, it still is a bit time consuming to add them - and I would prefer to have them stored in a text or some other easily accessed file (I have experience building FileMaker databases, so part of the process that I haven't detailed here would be to create this whitelist text file through FM as part of a larger process).

    I've wasted today looking through spam filters, mail add-ons, AppleScripts and Automator task, to no avail. I'm thinking an AppleScript would be the most likely answer, but I've had no luck in my searches (everything returns how to trigger an AppleScript in rules, not how to make an AppleScript rule). Any help pointing me in the right direction or thinking outside the box would be greatly appreciated.
  2. macrumors 6502a

    You can take a look at the example Mail scripts. In Snow Leopard you can find them in the Library-->Scripts-->Mail Scripts folder. Perhaps the Remove Messages From Sender or Thread script can point you in the right direction.

    Attached Files:

  3. macrumors 68020


    Who's your email provider? In Gmail you can write and import filters to sort mail.
  4. macrumors demi-god


    I have an idea using the built in Address Book that will do what you want and not clutter up your Address Book.

    Create a new Address Book group On my Mac and call it "recruiting"... then import all the address there. In the mail sidebar set it up to only show your main Address Book and not the new recruit one. Have the mail rule look for messages that are a member of the "recruiting" group and move to a folder or whatever you want.
  5. macrumors newbie

    Thanks all.

    @kryten I've taken a look at your scripts. You're right - they do offer some of the functionality I'm looking for. I just don't know if I'm equipped now to handle modifying something of that complexity. Any threads you know of that detail comparing text strings in AppleScript?

    @BrianBaugn It's through our work, so no gmail.

    @WeasleyBoy I'm not following how I would go about not displaying a group in my Address Book. My biggest concern with address book is syncing to my phone.
  6. macrumors demi-god


    Keep your personal addresses in the normal iCloud section of the Address Book, then add the new ones to the On my Mac area. The On my Mac ones will not sync over iCloud and will not show on iOS devices. You can just select the main iCloud group in the OS X address book and your will only see those.
  7. macrumors 6502a

    Take a look at the Operators paragraph in the text Class Reference on this page : https://developer.apple.com/library/mac/#documentation/applescript/conceptual/applescriptlangguide/reference/ASLR_classes.html#//apple_ref/doc/uid/TP40000983-CH1g-BBCIAHJF

Share This Page