One of the strengths of the Apple Mail program is its rules feature. If you have created mailboxes for different types of email messages, you can have Mail automatically send email messages to the right mailbox. In this tutorial, I'll walk you through the process of creating a new rule in Mail.
To begin, open the Mail Preferences
Pane and select the Rules tab.
Click the Add Rule button and
a dialog box will open. Type a descriptive name for
your rule next to Description. As an example,
let's create a rule called "Messages from Apple."

Next, set the conditions for email
messages that will be included in the rule. Click the
button on the left side of the dialog box that says
From. A long list of options appears in a
drop-down menu. For our example, we'll select
"From."
Click the button to the right of From to further
define the conditions for the rule. The options on the
drop-down menu will vary according to your selection
from the first list. Note that for some options, there
are no additional options to select. For our example,
we'll select "Contains."
Type the word you want Mail to match for the condition
of the rule (if needed) in the text box on the right
side of the second button. In our "Messages from Apple"
example, we'll type "Apple" so that our rule reads
"From Contains Apple." If you want you can add a second
condition by clicking the plus symbol next to the text
box. We'll leave our example rule with just one
condition.

After you've set the conditions for
your rule, you'll need to decide what you want Mail to
do with the email messages that meet the conditions.
Click the first button on the left side of the dialog
box under "Perform the following actions" to view your
options.
We'll select "Move Message." Note that we'll also need
to select a mailbox for the action. When you click the
button next to "to mailbox," all of your mailboxes,
except Smart mailboxes, will be listed.

If you want to add more actions to your rule, click the
plus symbol on the right side of the action
options.
When you finish defining a rule,
click the OK button. Mail will ask if you want
to apply the rule. If you select Yes, Mail will
apply the rule to all email messages in your open
mailboxes.
Now you see how easy it is to create rules in Apple
Mail. Once you get started, you'll be able to create
more complex rules to automatically organize all your
email.