During rule evaluation, if the attributedString of the message content returns nil, rule always fails

Originator:scott.j.little
Number:rdar://17958880 Date Originated:08-Aug-2014 03:47 PM
Status:Open Resolved:
Product:Mail Product Version:7.3 (1878.6)
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:
Occasionally there are HTML messages that are not able to be properly interpreted into an attributedString (see radar# 17958771) during the call to -[MFMessageRule _performAutoResponseActionOnMessage:encrypt:includeOrignalMessageText:]. That method does not deal with the nil return value gracefully, an exception is thrown and the rule always evaluates to nil, even if that content is not really relevant to the rule.

Steps to Reproduce:
1. Download the attached email message.
2. Open it in Mail (be careful not to click any links it is spam, though I don’t think it is malware, but I could be wrong)
3. Move the message into a folder (to run a rule against later)
4. Create an Inbox rule that redirects all messages (or messages from “onyx_consumer_goods@invitationsonly.club”) to some other email address (other actions can be applied to see the result, such as change the color) (see screenshot below for example rule).
5. Make sure all other rules are not active to avoid any conflicts.
6. Run that rule against the downloaded message in the folder you moved it to.
7. After a delay (with the beach ball) of 60 seconds the action (again see radar: 17958771 about that issue) the actions of the rule are not applied.

Expected Results:
Rule should be applied and message should be moved.

Actual Results:
Rule is ignored. An exception is thrown
“exception raised in routeMessages: -[__NSCFString replaceCharactersInRange:withString:]: nil argument”

Regression:


Notes:

The example email can be downloaded from:

http://media.littleknownsoftware.com/bugs/BadContent.eml

Here is a screenshot of the rule that I used.

http://media.littleknownsoftware.com/bugs/RuleExample.png

I can reproduce this without plugins installed.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!