Using "Flagged" in a Mail rule

I want to make all Flagged messages a different color (as well as being flagged) and looked at using a simple mail rule. However "Message is Flagged" is not a Mail rule criterion so it appears impossible to make something along the lines of: If any message is flagged, set colour of message to yellow...
Is there another way to achieve this result?

Hi,
I tried the same requirement as yours and it seems to be working in my case.
     IF( "BegBalance" -> "SA300" == +2011+ )
          "SA400" = #MISSING;
     ELSEIF("BegBalance" -> "SA300" == +2012+ )
          "SA400" = +1+;
     ENDIF
where SA300 and SA400 are my smart list members and +2011,2012+ and +1+ is are smart list ID which are numeric.

Similar Messages

  • Can i use Boolean Expressions in Mail Rules?

    Can i use Boolean Expressions in Mail Rules?
    I need to create a rule to check whether a message contains BOTH a first and last name of EITHER of two people.
    For example, the rule im looking to create goes something like this:
    If ANY of the following conditions are met:
    message content - contains - john & doe
    message content - contains - jane & doe
    ive tried and cant seem to get it to work...
    Message was edited by: mysterioso

    AFAIK Mail rules do not support boolean expressions.
    to do what you want you'd have to create two rules
    rule 1
    if ALL of the following conditions are met
    message content - contains - john
    message content - contains - jdoe
    and similarly for rule 2.

  • Error in using flags for retrieving mail folders

    Hi i tried with the blow clde for retrieving the folders of the mail . i am getting the error . i.e
    Javax.mail.MessagingException:connection timed out
    the code is;
    import java.util.Properties;
    import javax.mail.Authenticator;
    import javax.mail.Flags;
    import javax.mail.Folder;
    import javax.mail.Message;
    import javax.mail.PasswordAuthentication;
    import javax.mail.Session;
    import javax.mail.URLName;
    import javax.mail.internet.InternetAddress;
    public class MainClass {
    public static void main(String[] args) throws Exception {
    URLName server = new URLName("protocol://username@host/foldername");
    Session session = Session.getDefaultInstance(new Properties(), new MailAuthenticator());
    Folder folder = session.getFolder(server);
    if (folder == null) {
    System.out.println("Folder " + server.getFile() + " not found.");
    System.exit(1);
    folder.open(Folder.READ_ONLY);
    // Get the messages from the server
    Message[] messages = folder.getMessages();
    for (int i = 0; i < messages.length; i++) {
    // Get the headers
    System.out.println("From: " + InternetAddress.toString(messages.getFrom()));
    System.out.println("Reply-to: " + InternetAddress.toString(messages[i].getReplyTo()));
    System.out.println("To: " + InternetAddress.toString(messages[i].getRecipients(Message.RecipientType.TO)));
    System.out.println("Cc: " + InternetAddress.toString(messages[i].getRecipients(Message.RecipientType.CC)));
    System.out.println("Bcc: " + InternetAddress.toString(messages[i].getRecipients(Message.RecipientType.BCC)));
    System.out.println("Subject: " + messages[i].getSubject());
    System.out.println("Sent: " + messages[i].getSentDate());
    System.out.println("Received: " + messages[i].getReceivedDate());
    if (messages[i].isSet(Flags.Flag.DELETED)) {
    System.out.println("Deleted");
    if (messages[i].isSet(Flags.Flag.ANSWERED)) {
    System.out.println("Answered");
    if (messages[i].isSet(Flags.Flag.DRAFT)) {
    System.out.println("Draft");
    if (messages[i].isSet(Flags.Flag.FLAGGED)) {
    System.out.println("Marked");
    if (messages[i].isSet(Flags.Flag.RECENT)) {
    System.out.println("Recent");
    if (messages[i].isSet(Flags.Flag.SEEN)) {
    System.out.println("Read");
    if (messages[i].isSet(Flags.Flag.USER)) {
    // We don't know what the user flags might be in advance
    // so they're returned as an array of strings
    String[] userFlags = messages[i].getFlags().getUserFlags();
    for (int j = 0; j < userFlags.length; j++) {
    System.out.println("User flag: " + userFlags[j]);
    folder.close(false);
    class MailAuthenticator extends Authenticator {
    public MailAuthenticator() {
    public PasswordAuthentication getPasswordAuthentication() {
    return new PasswordAuthentication("username", "password");
    Any one can help me.

    Ok thankyou. i will do it from next time. Please give me code changes for my problem.

  • Mail Rules don't work in Mavericks

    It seems with the update to 10.9 Mavericks Mail rules no longer work. My email address was harvested by spamers and I have been using rules to weed throught the 100's of emails that I receive each day.
    Russian Brides, Vigra, Learn a new language get moved into the trash when delievered. Now nothing happens.
    I just tried to write a new rule and when I clicked the Prefs pannel I got the spinning cursor. After waiting for some time I did a force quit only to find that Mail was not responding.
    Anyone have any ideas? I did not see any major changes with Mail and Mavericks so I'm not sure why it's been effected.
    MD

    You might condider using an Applescript with Mail Rules.
    Here's one that I use (Use whitelist to not move to spam):
    (Just edit to your junk or whitelist)
    Note:  The Applescripit must be saved to: ~/Library/Application Scripts/com.apple.mail/
    The rule:
    The AppleScript:
    using terms from application "Mail"
              on perform mail action with messages theMessages
                        tell application "Mail"
                                  repeat with theMessage in theMessages
                                            set theSender to (sender of theMessage)
                                            set theReplyto to (reply to of theMessage)
                                            set theSubject to (subject of theMessage)
                                            set theHeader to (all headers of theMessage)
                                            set theContent to (source of theMessage as string)
                                            set theAccount to (account of mailbox of theMessage)
                                            if my blacklist(theSender, theReplyto, theSubject, theHeader, theContent) ¬
                                                      and not my whitelist(theSender, theHeader) then
                                                      my moveToJunkFolder(theMessage, theAccount)
                                            end if
                                  end repeat
                        end tell
              end perform mail action with messages
    end using terms from
    on blacklist(f, r, s, h, c)
              if h contains "X-YahooFilteredBulk" or ¬
                        h contains "Received-SPF: fail" or ¬
                        h contains "Received-SPF: softfail" or ¬
                        h contains "Received-SPF: error" or ¬
                        h contains "Received-SPF: permerror" or ¬
                        h contains "Received-SPF: temperror" or ¬
                        h contains "streamsendbouncer@" or ¬
                        s contains "[Bulk]" or ¬
                        f contains "Vigra.candianmeds.com" or ¬
                        f contains "[email protected]" or ¬
                        f contains ".cz" or ¬
                        r contains ".ma" then
                        return true
         end if
    end blacklist
    on whitelist(f, h)
              if f contains "aicpa" or ¬
              f contains "eWeek.com" or ¬
                        h contains "from macbook-air.local" then
                        return true
              else
                        return false
              end if
    end whitelist
    on moveToJunkFolder(m, a)
              tell application "Mail"
                        try
                                  set the read status of m to true
                                  set the junk mail status of m to true
                                  set theAccount to (account of mailbox of m)
                                  set mailbox of m to (mailbox "Junk" of a) --  Move to "Junk"
                        end try
              end tell
    end moveToJunkFolder

  • How do I restore my mail rules from Time Machine?

    There's a thread here with a somewhat complex process for restoring rules after an update to Mt Lion.
    HOWEVER, this is a case where MT lion has been working nicely for months, and allovasudden all the rules just disappeared.
    I'm not sure what I should look for and tweak to fix this.
    I'm not afraid of using the terminal.

    The mail rules are stored in your ~/Library/Mobile Documents/com~apple~mail/Data.MailData folder, in a plist called SyncedRules.plist.
    If you're signed into iCloud D&D, that's where you'll find it.
    If you're *not* signed into iCloud, then you probably have a folder called something like ~/Library/Mobile Documents.####### where the # signs are actual numbers.  Digging into that folder, you'll fild the SyncedRules.plist file.
    Thing is, I don't know how Mail uses rules without iCloud; if there's a "local" rules location.  There probably is, but someone else who's not using iCloud may have to help you there...

  • Using a Mail rule to run an AppleScript

    I've been trying to get a Mail rule to run a very simple AppleScript on 10.5.3 and it just doesn't work, period.
    I've tried making everything as simple as possible:
    1. My Mail rule sets the background color of a message and runs the AppleScript if the subject contains "test".
    2. The AppleScript displays a Finder alert.
    [(screenshot)|http://i26.tinypic.com/nqxou8.png]
    Naturally, the script runs fine within the Script Editor. I also know that the rule works since the background color action gets applied.
    But, the AppeScript never runs when I apply the rule to a message manually or when it gets automatically applied to new messages. I really can't imagine where I'm going wrong here...

    You can't simply feed it some arbitrary script to execute, you have to write a handler that Mail can dispatch events to. This generally looks something like
    using terms from application "Mail"
    on perform mail action with messages theMessages for rule theRule
    tell application "Mail"
    repeat with suspectMessage in theMessages
    --do something
    end repeat
    end tell
    end perform mail action with messages
    end using terms from

  • Using Mail Rules, how do I remove from inbox my moved messages?

    My goal is decluttering my inbox, so all mailing list group messages go to their respective mailboxes, and my general inbox only shows personal messages.
    In Mail 7.0 under Mavericks, I can use Rules to move a message to an IMAP folder on a remote server or to a mailbox folder on my Mac. An example would be moving to a folder all the mail from a particular sender, like a Yahoo group, so I can go to that folder and see in on eplace all the mail related to that sender.
    However, when a message has been moved to another folder, that mail message remains in the general inbox. I want such moved messages to vanish from my general inbox at the same time as they are moved to distinctive mailbox folders by the Rules filters.
    Smart mailboxes may help, but my attempts so far have not made the moved messages leave my inbox. I may well be missing something, though.
    FYI, under Mountain Lion, using Mail Rules, I was able to move some specific types of mail to a mailbox folder on my Mac, and in those cases the mail did vanish from my inbox. The problem was the this rule protocol worked in a few cases but not in most of the others, so the results were inconsistent. Also, moving the mail to a folder on my Mac consumed disk space, so I would rather move messages to a folder on a remote mail server, so my computer keeps more free disk space, but I do not know who to make such moved message leave my inbox.
    I am wide open to experienced users sharing your wisdom.

    Install this add-on: https://addons.mozilla.org/en-US/firefox/addon/adblock-plus/

  • Need help filtering spam using Mail Rules

    Hello
    My me.com address is on a **** spam email circulation list. Most of the emails come from .RU or .UA and every email address is different. I receive up to 3 a day.
    I have tried Mail rules to filter this, but for some reason it is not working. I have tried filtering the individual email address and all .RU addresses, but the Mail filter just doesn't apply the rule.
    I normally use Aliases for any only registration - so I am not sure how my real me.com account name was found. I have also tried VIW/MESSAGE/RAW SOURCE (see results below). I have replaced my me.com email address with "[email protected]".
    This spam is driving me nuts, so any help would be appreciated.
    Thanks
    Rob
    Return-path: <[email protected]>
    Received: from smtpin124-bge351000 ([unknown] [10.150.68.124])
    by ms221.mac.com (Sun Java(tm) System Messaging Server 7u3-12.01 64bit (built
    Oct 15 2009)) with ESMTP id <[email protected]> for
    [email protected]; Tue, 29 Dec 2009 19:16:44 -0800 (PST)
    Original-recipient: rfc822;[email protected]
    Received: from apport.ru ([unknown] [84.36.155.255])
    by smtpin124.mac.com (Sun Java(tm) System Messaging Server 7u2-7.04 32bit
    (built Jul 2 2009)) with SMTP id <[email protected]> for
    [email protected] (ORCPT [email protected]); Tue, 29 Dec 2009 19:16:44 -0800 (PST)
    X-Proofpoint-Virus-Version: vendor=fsecure
    engine=1.12.8161:2.4.5,1.2.40,4.0.166
    definitions=2009-12-29_17:2009-12-12,2009-12-29,2009-12-29 signatures=0
    X-Proofpoint-Spam-Details: rule=notspam policy=default score=7 spamscore=7
    ipscore=0 phishscore=0 bulkscore=1 adultscore=4 classifier=spam adjust=0
    reason=mlx engine=5.0.0-0908210000 definitions=main-0912290250
    Received: from [84.36.155.255] (port=38176 helo=looep)
    by xasfb.ia with psmtp id cx2519337 for [email protected]; Wed,
    30 Dec 2009 01:51:44 +0100
    Message-id: <[email protected]>
    From: Maynard Chapman <[email protected]>
    To: [email protected]
    Subject: Attractive tlittle
    Date: Wed, 30 Dec 2009 01:51:44 +0100
    MIME-version: 1.0
    Content-type: multipart/alternative; boundary="----=NextPart_xqdmfxhq.39935"
    X-Priority: 3
    X-MSMail-priority: Normal
    X-Mailer: Microsoft Windows Mail 6.0.6001.18000
    X-MIMEOLE: Produced By Microsoft MimeOLE V6.0.6001.18049
    This is a multi-part message in MIME format.
    ------=NextPart_xqdmfxhq.39935
    Content-Type: text/plain;
    charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    Full videos =http://members.lycos.co.uk/gzoieks/Mysterious teniees
    ------=NextPart_xqdmfxhq.39935
    Content-Type: text/html;
    charset="us-ascii"
    Content-Transfer-Encoding: quoted-printable
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>Full videos <a =href=3D"http://members.lycos.co.uk/utiirce/">http://members.lycos.co.uk/gzoieks/
    Mysterious teniees</html>
    ------=NextPart_xqdmfxhq.39935--

    I am having exactly the same problem with mail not applying the rules. I have a rule set that if any mail is considered junk mail, to redirect it to [email protected] and to move it to the trash folder. I click "apply rules" on my junk mail, nothing happens. New spam comes in that it marks as Junk, nothing happens. I mark an email as junk, nothing happens.
    After over a year of problem after problem with my mac, I have almost lost faith. Can someone please help us?? Is anyone out there??
    Thank you,
    Kristen

  • Stop using flags in mail

    email from one of the groups I set up arrives with a flag on each mail. I don't need flags! How can I turn off flags!

    Select the message, then go to the Flag in the menu bar, and choose 'Clear Flag'.

  • Mail Rules missing "mark as unread" and "mark as unflagged"

    I'm adding some new rules in Mac Mail and just noticed that there is no option to "mark as unread" in my list. My friend has it coming up, but it isn't there for me.
    When I click to add a new rule, the drop-down for Perform actions lists "delete", "mark as read" and "mark as flagged". I'm missing "mark as unread" and "mark as unflagged".
    Why would I be missing those options?
    Thanks,
    Morton++

    Mail rules doesn't offer these options which is why you don't have them. Your friend must be mistaken. and anyway since the rules are only applied to new messages there is no point in having the option to mark them as unread - they are unread already. You can add a rule to unflag messages using apple script but if I'm not mistaken all new messages are unflagged by default too so there is no point for this one either.

  • Transfer Mail Rules from Leopard to Mountain Lion

    I have succesfully moved my mail, mailboxes and folders from my old Power PC to my new iMac by moving my Library>Mail folder from one to the other.
    The only thing that didn't carry over were my Mail Rules.
    Is there some other file I'm missing?
    Thanks,
    - Peter

    Mail rules are stored in your user Library/Mail/V2/Mail Data/SyncedRules.plist or at least they are on my computer.
    To make your user library visible:
    Hold down the option key while using the Finder "Go To Folder" command. Enter ~/Library. If you prefer to make your user library permanently visible, use the Terminal command found below. It does work with Mountain Lion.
    http://osxdaily.com/2011/07/22/access-user-library-folder-in-os-x-lion/ 
    You might want to bookmark the command. I had to use it again after I installed 10.8.2. I have also been informed that if you drag the user library to Finder it will remain visible.

  • Lost mail rules when upgrading to ML, can't restore from time machine

    Hi,
    I've installed mountain lion and restored from time machine and mail rules were not there. There's only news from apple.
    I tried to restore the rules myself (MessageRules.plist and MessageRules.plist.backup) but when opening mail rules were not there yet. Nevertheless, i can add rules manually, so if there was a way of looking at the past rules I could just copy them (though it's not the best way).

    My rules are still there, so perhaps Apple support speak with resource forked tongue.
    Comparing an old (pre ML) rules file from 20th June with the ML one, the differences are:
    The file name was: MessageRules.plist, the ML one is SynchedRules.plist. Both are in my V2 folder, but the old Rules have been copied (by Mail, not me) into the new SynchedRules file.
    In the old file, for each item (Rule) the first line was Active (Key) String (Type) 1 (Value). In the ML file, this line is no longer there, so the first line is AllCriteriaMustBeSatisfied.
    You can see these differnces in the "preview" part of Finder Show Info, if you have the two files to compare.
    Thus, just copying and renaming the old Rules file probably won't work, because of this difference. Mail probably just makes a new file because the copied file isn't as expected. It should be possible to edit the old plist file to remove the "Active" line, and rename it to SynchedRules.plist (but see below). The top is slightly different, just below <dict>, as this relates to the Active line. There are a  couple of lines at the bottom that aren't in the new file.
    The "Active" line that has gone is now in a file called RulesActiveState.plist. This file is just a list of RuleIds from the SynchedRules.plist (like this:
    AC6F6611-FF61-4AA6-9682-BA100EFAC233)
    Doing this does sound rather tedious, but might be quicker than manually re-entering blocked email addresses etc. to replicate old rules. As plist files are in xml format, it should be possible to use a text editor to delete the unwanted "Active" line from the message rules list by Find & Replace All (with nothing). All this could then be copied to the "SynchedRules.plist. You would need to copy the RuleIds into the RulesActiveState.plist as well.
    Make a copy of the files first just in case...

  • Transfering mail rules from Lion to Yosemite.

    Help please, how do you transfer mail rules from Apple Mail 5.3 in Lion to 8.0 in Yosemite.  Thanks

    The file in question that you are looking for is SyncedRules.plist in the MailData folder.  I tried re-naming a MessageRules.plist file and it didn't work.  It would be an arduous task, but the best suggestion that I have, other than to re-create your rules, is to use a texteditor like SubEthaEdit to make the format of MessageRules comply with the format of SyncedRules.plist.  I haven't tried it myself, but it might work.  Best of luck!!!

  • How to import Mail rules from Lion to Mavericks?

    I tried importing my several dozen rules from OS X 10.7.5 to Mavericks 10.9.4. I tried the method described by SECollins7 here:
    Import Lion Mail rules into Mavericks Mail?
    It did not work. Nor does manually copying the text from «MessageRules.plist» to «SyncedRules.plist». They just do not appear in the rules settings in Mail in Mavericks.
    Is there a way to import rules anyway?
    Thanks for any hints!

    This issue is caused by a combination of two things:
    The file used in previous versions of OS X to store local (not iCloud-based) Mail rules is not used in Mavericks.
    The migration process doesn't transfer the rules from the old file to the new one, which has a different format.
    You may be able to recover the Mail rules by taking the steps below.
    Warning: Do not use this procedure if you synchronize Mail rules with other devices via iCloud.
    Quit Mail if it's running.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    cd Library/Mail/V2/MailData; /usr/libexec/PlistBuddy -x -c 'Print :rules' MessageRules.plist > SyncedRules.plist
    Copy the selected text to the Clipboard by pressing the key combination command-C.
    Launch the Terminal application in any of the following ways:
    ☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
    ☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
    ☞ Open LaunchPad. Click Utilities, then Terminal in the icon grid.
    Paste into the Terminal window by pressing the key combination command-V. I've tested these instructions only with the Safari web browser. If you use another browser, you may have to press the return key after pasting.
    Wait for a new line ending in a dollar sign (“$”) to appear. You can then quit Terminal. Test.

  • Mail rules -- apply only to inbox or all mailboxes?

    I've done a major revamp of my Mail application. I used to have a dozen or so mailboxes, and some had rules that would move newly arrived messages from my inbox to a designated mailbox.
    I've now opted instead to use a dozen or so 'smart mailboxes.' I've moved all my messages back to my inbox and deleted the dozen or so mailboxes. The smart mailboxes nicely filter the messages as I've constructed the smart mailbox rules. However, I still have two mailboxes whose content isn't easily filtered via smart mailboxes.
    Now, back to my inbox .... It's got a few thousand messages. My goal is to create a mail rule in preferences that would move anything older than 30 days into secondary mailbox. If I write this rule and run it, does it apply ONLY to my inbox? Or to the inbox and any other mailboxes?

    I played around with it and found out that my rule to move older docs to a separate folder only runs on my inbox, as I had hoped.

Maybe you are looking for

  • Jabber for Windows - Disable "Sign me in when Cisco Jabber starts"?

    I am looking for a way to disable  the auto sign-in checkbox for Jabber for Windows.  this is an issue in LDAP authenticated roll-outs when password policies are in effect (change passwords every 90 days).  When auto sign in is enabled for jabber aft

  • Problem with "user data detail"

    Hi  I am using EDQ 9.0.6 in Window 7 platform. I need some support from the community on how to make "user data detail" tool work. As show in the picture in the link, http://img843.imageshack.us/img843/5985/vend.jpg in The datapane, there is no user

  • New source system for HR extractors - easy way to change source system?

    Hi Our HR module is going to be seperated from the ECC module and thereby placed on a new server and have its own source system. In BI we have to handle this as well so that all 7.0 transformations and 3.5 transferrules etc. have to be mapped to the

  • Extending component class

    Just recently wrote a diary applet that includes all twelve months of the year and thier corresponding days in month panels. The user can cylcle through each year and the panels change accordingly. User can also select and de-select days of the week

  • Why does my home user name not change when I created a new administrator

    why does my home user name not change in finder when I created a new administrator?