Mail.app rules - how to write the following requirement

Please be aware that mail only applies rules to new messages. So deleting old messages may not work as expected, since the rule is checked once when the message is new the "date received" test fails. From the doc:

Rules are automatically applied to incoming messages, but you can apply a new or modified rule to selected messages you’ve already received.

You may apply rules to selected messages by:

Select the messages and then choose Message > Apply Rules.

You may be able to write an applescript to automate the last step.