Mail rules not working...

I have set a mail rule to mark all messages as read. This rule will only work if I force it to apply (Cmd +A to select all then right click apply rules). The messages show as read on Mail, but when I view the same account on my ipad they still show as being unread. Is this a Mavericks problems?


I am still having lots of problems getting mail to apply rules. Someone has suggested that it only works on new mail. Very confused. It works sometimes and doesnt at other times.


I am using Gmail

MacBook Pro, iOS 7.0.3

Posted on Nov 8, 2013 1:05 PM

Reply
60 replies

Jan 23, 2014 7:22 AM in response to Trabbbb

Same problem here... simple Applescripts that mail launched just fine before the update now won't launch automatically.... if I click apply rules, they work just fine, I've made the modifications required for mavericks.


Now its the mail app that just doesn't want to launch the applescript from the "Run Applescript" rule that worked just fine before.... and which was very useful.


I am not using a gmail account with mail so it has nothing to do with that.

Jan 30, 2014 1:45 AM in response to rb290169

Hi.


If you have a look in your rules do you have a rule named "News from Apple"?


If you do, then change the rule that says evaluate no more rules.


Or one of your rules has this condition set. Check other rules to make sure that this is not enabled as any rules that appear after this condition will be ignored.


Let me know if I have guessed correctly. 😎

Feb 4, 2014 8:08 AM in response to bobmermans

Hi folks,

I have encountered this problem also, I use xxxxxx@iCloud.com as my email address. I am sure my rules have worked, but now I have to take manual action to make them work. One 'trick' that makes my rules work is to make a change to one of the rules, it does not matter which one, and the change does not matter either, then click Apply on the Rules dialog that pops up asking if you want to apply the rules. Then magically all rules are executed.


Somebody suggested to give Apple feedback on this case. That is a natural thing to do, but - hm - how do you do that?


Obe

Feb 11, 2014 8:33 AM in response to rb290169

I've compiles a crude applescript workaround to deal with the problem until its solved:

Copy and paste this into a new Applescript editor document and save as an app.... and let it run all the time... it'll check and apply rules every 2 minutes.... as long as you don't press on a key or click something when its doing its series of keystrokes, and the only way to quit it is to force quit. As I said, its crude, but it works for me.

tell application "Finder"

tell application "Mail"

set a to 0

repeat with theAccount in (every account)

repeat with theBox in (every mailbox of theAccount)

set a to a + (count (messages in theBox where read status is false))

end repeat

end repeat

end tell

if a is not 0 then

tell application "Mail" to try

tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes) whose read status is false}

activate

end try

tell application "Mail"

activate

end tell

tell application "System Events"

key code 120 using control down

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke space

repeat 12 times

delay 0.1

key code 125

end repeat

delay 1

keystroke space

end tell

end if

delay 60 * 2

end tell

Feb 12, 2014 1:32 AM in response to highab2000

Line in bold added so it works if mail is minimised to the dock



tell application "Finder"

tell application "Mail"

set a to 0

repeat with theAccount in (every account)

repeat with theBox in (every mailbox of theAccount)

set a to a + (count (messages in theBox where read status is false))

end repeat

end repeat

end tell

if a is not 0 then

tell application "System Events" to keystroke "1" using {option down, command down}

tell application "Mail" to try

tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes) whose read status is false}

activate

end try

tell application "Mail"

activate

end tell

tell application "System Events"

key code 120 using control down

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke tab

keystroke space

repeat 12 times

delay 0.1

key code 125

end repeat

delay 1

keystroke space

end tell

end if

delay 60 * 2

end tell

Feb 12, 2014 4:18 AM in response to Loose_Canon

I cut the relevant bit out of a script which I created to do other things too, maybe I didn't cut it correctly.



tell application "Finder"

tell application "Mail"

set a to 0

repeat with theAccount in (every account)

repeat with theBox in (every mailbox of theAccount)

set a to a + (count (messages in theBox where read status is false))

end repeat

end repeat

end tell

if a is not 0 then

tell application "Mail"

activate

tell application "System Events" to keystroke "1" using {option down, command down}

tell application "Mail" to try

tell message viewer 1 to set selected messages to {first message of beginning of (get selected mailboxes) whose read status is false}


activate

end try

tell application "Mail"


activate

end tell

tell application "System Events"


key code 120 usingcontrol down


keystroketab


keystroketab


keystroketab


keystroketab


keystroketab


keystroketab


keystrokespace

repeat 12 times

delay 0.1

key code 125

end repeat

delay 1


keystrokespace

end tell

end tell

delay 60 * 2

end if

end tell



It assumes that you want to apply the rules to a message that is marked as unread

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Mail rules not working...

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.