Understanding Custom Actions
In Table 17.1, you saw that one of the choices for a rule is to perform a custom action. Custom actions cannot be created by the average user, only by a programmer working with C++ to create a .dll file that works with Rules Wizard and Inbox Assistant. Shareware and freeware custom actions are now available for a variety of tasks:
Managing addresses in Contacts folders or the Personal Address Book
Adding signatures
Printing messages and attachments
Saving attachments
Running any program
I keep a list of available custom actions at http://www.slipstick.com/exchange/client3.htm#custom. For any custom action you obtain, follow the developers installation instructions.
Heres how to build a rule using a custom action:
Follow the normal procedure under Building a Rule Step-by-Step until you see the What do you want to do to the message? screen of the wizard.
Under What do you want to do to the message?, check the box for perform a custom action.
In the Rule description box, click on the underlined words a custom action.
In the Select Custom Action dialog box (Figure 17.13), under Choose an action to be performed, choose one of the custom actions you have installed.
Click Change. This will display an additional dialog box, specific to the custom action, where you set various parameters for that action. Figure 17.14 shows the options for the CaBook custom action for managing addresses (available from http://www.mokry.cz/exchange/). Click OK when you have set the parameters, which will be copied to the Action value box on the Select Custom Action dialog box.
Click OK to close the Select Custom Action dialog box and return to the Rules Wizard.
Click Finish to complete the rule, or click Next to add exceptions and edit the name of the rule.
Working with Server Actions
If you connect to Microsoft Exchange Server, you need to understand which rules can run on the server even when you are not connected and which are client-only and require you to be logged on with Outlook before they take effect.
The following types of Rules Wizard rules are always client-only when the Microsoft Exchange Server service is part of your profile:
notification actions
replies
rules that move or copy messages to a folder outside your mailbox
custom actions
rules that involve Outlook-specific actions, such as setting message flags or categories
Special Note: If you do not connect to an Exchange server, all rules are client-only. Even though some rules may not be labeled client-only in the Rules Wizard list, they still will not run unless Outlook is running.
In some cases, you can take a different approach to create a rule that will run on the server. For example, instead of copying a message to a public folder, you can forward it to the public folder using the e-mail address for that folder (see Exchange Server Addresses in Chapter 15).
Replies dont work on the server because the Rules Wizard builds a reply from an Outlook .oft template file. However, you can use the Inbox Assistant to create a reply that will run completely on the server. See Maintaining Two Sets of Rules later in this chapter.
Understanding Rules Wizard Limitations
As powerful as it is, you cant do everything with the Rules Wizard that you might want to. Here are some things the Rules Wizard cant do:
Eliminate unwanted messages received via an Internet mail account before you download them from the server. The Rules Wizard doesnt go to work until the message is already in your Inbox.
Create tasks, contacts, and other Outlook items automatically when you move or copy a message to another Outlook folder. The copy and move functions of the Rules Wizard do not work the same as dragging a message to one of the other folders.
Apply rules to messages received locally when you synchronize offline folders with an Exchange Server mailbox.
Create conditions using information from Internet mail header elements, other than the To and From addresses, subject, and importance.
Also note that if a task request response, voting response, or meeting request response is moved by a rule to another folder, the information in that response will not be tracked by the original message because moving the message causes it to bypass Outlooks automatic processing mechanism.
MANAGING RULES
Looking back to Figure 17.12, lets take a look at some additional functions that can help you manage Rules Wizard rules. If you want to follow along, choose Tools, Rules Wizard to display the Rules Wizard dialog box.
Modifying Rules
To temporarily deactivate a rule, clear the check box next to it.
To add new conditions or actions to a rule (or delete conditions or actions), select the rule, then click Modify. You now have the opportunity to walk through the entire Rules Wizard again.
To change the name of a rule, select it, then click Rename.
To delete a rule completely, select it and click Delete.
Importing and Exporting Rules
You can share rules with other people or use them in different profiles on your own machine.
To save a set of rules so you can use them elsewhere, click Options, then click Export Rules in the Options dialog box (Figure 17.15) and give the rules set a file name and location. To import a saved set of rules, click Options, then in the Options dialog box (Figure 17.15), click Import Rules and select the rules set you want to import.
Updating the Exchange Server
Normally, the rules you build with the Rules Wizard are copied to the Exchange server whenever you click OK to close the Rules Wizard dialog box. Rules created while you were working offline, not connected to the server, are copied the next time you connect to the server.
If you prefer to control when rules are copied to the server, select Manually on the Options dialog box (Figure 17.15). Whenever you want to copy new rules to the server, click Update Now.
Special Note: If the Inbox Assistant is not available, return to the Add-Ins dialog box, click Install, and add the Emsuix.ecf extension file.
The Manually setting and the Update Now button have no effect if you are not using Microsoft Exchange Server.
USING THE INBOX ASSISTANT
If you have previously used Microsoft Exchange with Microsoft Exchange Server, then you may already have a set of rules for processing incoming messages rules you created with the Inbox Assistant feature of Exchange (available only when you have Microsoft Exchange Server in your profile and actually connect to the server). The Inbox Assistant is available in Outlook, too. While the Rules Wizard is both easier to use and often more versatile, especially when it comes to Outlook-specific features, you may want to use the Inbox Assistant in some cases.
In this section, we cover how Inbox Assistant rules are converted to Rules Wizard rules and how to switch back and forth between these two tools.
Converting Inbox Assistant Rules
If you have previously used the Inbox Assistant, the Rules Wizard asks you whether you want to convert existing Inbox Assistant rules to Rules Wizard rules (see Figure 17.16). Go ahead and choose Yes. The Inbox Assistant rules are converted to Rules Wizard rules but are not deleted; then the original Inbox Assistant rules are turned off.
After conversion, the former Inbox Assistant rules can be seen in the Rules Wizard (Figure 17.17). Youll probably want to rename them.
In Figure 17.17, notice that for a reply rule, an .oft template file (see Chapter 18) is created. The reply is also turned into a client-only rule, which means it runs only when you log on to Microsoft Outlook. This is an example of a rule you might want to keep as an Inbox Assistant rule, rather than a Rules Wizard rule, using the techniques in the next section.
One more note about converting rules. If you have more than about 40 Inbox Assistant rules and you use Exchange Server 4.0, the Rules Wizard may not be able to convert them all the first time. In this case, youll need to disable the Rules Wizard (see the procedure in the next section) and use the Inbox Assistant to delete any rules that you no longer need. Then, re-enable the Rules Wizard and finish converting the Inbox Assistant rules.
If you use Exchange Server 5.0, this shouldnt be a problem because version 5.0 allows more room for rules storage than version 4.0.
Maintaining Two Sets of Rules
As noted in the previous section, the Rules Wizard does not remove Inbox Assistant rules when it converts them; it just turns them off. You can continue to use the Inbox Assistant, but you first need to disable the Rules Wizard temporarily.
To disable the Rules Wizard and make the Inbox Assistant available again,
Choose Tools, Options, then switch to the General tab and click Add-In Manager.
In the Add-Ins dialog box (Figure 17.18), clear the boxes next to the Rules Wizard add-ins.
Click OK twice to close the Add-Ins and Options dialog boxes.
You should now be able to choose Tools, Inbox Assistant to run the Inbox Assistant and delete any rules you no longer need or turn on any rules that you might want to keep in the Inbox Assistant, rather than as Rules Wizard rules.
The types of rules you can construct with the Inbox Assistant are rather like those you can make with the Rules Wizard. However, theres no wizard interface to help you. Instead, you need to build the rule, selecting conditions and actions as appropriate in the Inbox Assistant dialog boxes, which are very similar to the Out of Office Assistant dialog boxes well see in the next section.
Reply rules are one type that you might want to keep in the Inbox Assistant, if you need to run them from an Exchange server while you are not logged on with Outlook. If you connect to Exchange Server 5.0, you might also consider using the Inbox Assistant to maintain rules that forward a message. Exchange Server 5.0 lets you forward a message so that the recipient sees who the message originally came from and when it was sent. The Rules Wizard, on the other hand, does not include any information about the original sender when it forwards a message.
To restore the Rules Wizard after using the Inbox Assistant,
Choose Tools, Options, then switch to the General tab, and click Add-In Manager.
In the Add-Ins dialog box (Figure 17.18), select the Rules Wizard add-ins.
Click OK twice to close the Add-Ins and Options dialog boxes.
Remember, if you have both Rules Wizard and Inbox Assistant rules active, the Rules Wizard rules run first, then the Inbox Assistant rules.
USING THE OUT OF OFFICE ASSISTANT
Like the Inbox Assistant, the Out of Office Assistant is available only if you connect to Microsoft Exchange Server. In other words, you need to have the Microsoft Exchange Server service in your profile and start Outlook so that it connects to the server.
To use the Out of Office Assistant, choose Tools, Out of Office Assistant. The Out of Office Assistant dialog box (Figure 17.19), includes three sections:
A choice of whether you are In the Office or Out of the Office
A box for you to enter the AutoReply text that you want delivered to people who send you messages while youre out of the office
Rules that you want to run while youre out of the office
The AutoReply text is sent just once to each person who sends you a message. Always fill it in. If you leave it blank and choose I am currently Out of the Office, recipients will get a blank message from you.
The rules at the bottom run instead of any Inbox Assistant or Rules Wizard rules you have set up. To add a rule, click the Add Rule button. To edit a rule, click the Edit Rule button. In either case, select conditions and actions in the dialog boxes shown in Figure 17.20 and Figure 17.21.
The most obvious use of the Out of Office Assistant is to alert your contacts that you wont be able to respond to their messages for a while. At the same time, you may want to forward certain messages to your assistant or a colleague. Others may need to be filed away in folders, just as you might do with the Rules Wizard.
Note, however, that this feature may not be as useful as it looks. It isnt very smart about not sending Out of Office replies to mailing lists and other addresses where it isnt really appropriate. Also, in some Exchange Server environments, Out of Office replies to the Internet are blocked. You may want to check with your Exchange Server administrator before you spend a lot of time tweaking the Out of Office Assistant.
TIPS AND TRICKS
Lets wrap up this chapter on Outlooks automatic message processing with more examples related to junk mail, mailing distribution lists, and archives.
Building a Junk Mail Filter
Junk e-mail, also known as spam, is an annoying side effect of having an Internet address. Junk mail often is sent with bogus From or Reply To addresses, but may fit certain patterns of addresses included in the body of the message, particular subjects, and other elements you can use to trigger a rule.
If you want to build rules to handle suspected junk mail, here are some basic principles to follow:
Put the junk mail rules at the bottom of the Rules Wizard list so they fire after all your real mail has been handled.
Rather than deleting suspected junk mail with a rule, you might want to move it to a folder from which it can be deleted either manually or with the AutoArchive feature. (See Using a Rule to Expire Mail below.)
If you do decide to delete messages with a rule, you might also transmit a reply that lets the sender know you deleted the message without reading it. That way, if the rule deletes a message that wasnt really junk mail, at least the sender will know and can try to reach you again.
Most junk e-mailers put your address in the Bcc field. You can use rules to move to separate folders all the real mail that might appropriately be sent to you via a Bcc or distribution list address such as items from your boss or messages from an Internet mailing list. Much of whats left is junk mail. One way to separate those messages is to create a rule thats nothing but one big exception!
Heres what I have in mind: Create a rule for incoming messages with no conditions at all; the Rules Wizard will notify you that this means the rule will be applied to all incoming messages and ask whether thats OK. Choose Yes, then add an action to move messages to a Junk Mail folder. On the exceptions screen, select except if my name is in the To or Cc box. Make sure you put this rule at the bottom of the list. (On my system, I also have this rule notifying me with the message Moved to Junk Mail folder, so I can quickly see whether any messages were moved there by mistake and adjust my rules accordingly.)
Thanks to Doug Toombs and his SPAM Filter Page at http://www.erols.com/dtoombs/spam.htm for some of the above ideas. For more about the legality of junk e-mail and what can be done about it, visit http://spam.abuse.net/spam/.
Filtering Posts to Distribution Lists
Imagine you are a section chief and frequently receive messages sent to a distribution list of section chiefs within your organization. You also have occasion to post to that distribution list yourself. You might want to use a rule to keep the messages that you send to the list out of your own Inbox (because you already have a copy in Sent Items). To do this, create a rule with the Delete action using the following two conditions:
from people or distribution list
sent to people or distribution list
For the from rule, select your own e-mail address from the Global Address List. For the sent rule, use the address for the distribution list, also from the Global Address List.
Filtering Messages from a Mailing List
In most cases, the distinguishing feature of an Internet mailing list is the To address. Therefore, thats what you should use to create the rule. If you cant specify a condition that consistently catches the To address, then look for a footer thats the same on all messages from the list. Use text from that footer to build your rule.
Using a Rule to Expire Mail
If you combine the Rules Wizard with the AutoArchive function of Outlook (see Archiving Items in Chapter 14), you can build a rule to cause particular messages to be purged from your system after a certain number of days.
First, create a folder just for this purpose, and switch to that folder. Choose File, Folder, Properties. On the AutoArchive tab, specify how long you want to keep items and whether you want to delete or archive them.
Now, create a rule that moves messages meeting your conditions to the folder youve just created. When matching messages arrive, theyll be moved to the folder, then purged when AutoArchive does its work.
SUMMARY
Automatic processing of incoming and outgoing messages is one of the most powerful features of Microsoft Outlook. For each rule you create with the Rules Wizard, you can specify one or more actions. Rules resemble filters, and you should test the rules thoroughly to make sure the conditions are exactly right. Some key points to remember:
There are two parts to every rule: one or more conditions and one or more actions.
Some rules wont run until you log on to Outlook.
For Exchange Server users, many rules can run on the server when you are not logged on.
You can switch back and forth between the Rules Wizard and Inbox Assistant rules.