Novell is now a part of Micro Focus

Understanding Rules

Novell Cool Solutions: Feature
By Steve Christensen

Digg This - Slashdot This

Posted: 3 Jun 1999

Move that here. Forward that there. Delete that one altogether. Man, it's all drudgery! Your burgeoning Item List is so full you swear you can see the pixels sagging. One more piece of Spam on top and you know the sides will burst and you'll be picking icons and letters out of your keyboard for a week. But who has time to organize this mess? Well, GroupWise can help, of course.

We've talked about GroupWise Rules here before...and all the fabulously twisted things you can do with them. But now it's time to get back to basics: creating rules that make life easier and making them work right. Rules have always been a strength in GroupWise; Rules in GroupWise 4.1 let you automate many processes without much hassle. They were simple and straightforward, but they didn't let you automate some of the more complex tasks. However, GroupWise 5 has beefed up Rules, adding advanced filtering capabilities such as searching for Item Status and relative dates (today or tomorrow in addition to 12 December 1997). Rules can also perform more actions than ever before. But that means that creating them is maybe a little more complex than before too. Well, don't worry, we'll show you how to design, implement, and test a rule so you can't go wrong. And we'll help reduce any undue embarrassment, such as spamming 50,000 innocent Internet devotees.

How do Rules Work?
Rules are made of three parts: the trigger event, the conditions, and the action. When you save a rule, it is placed in the Rules list. A rule is run when its triggering event is, um, triggered. For example, when a possible triggering event happens in GroupWise, such as a new item arrives in your Mailbox, or you open a folder, GroupWise goes down the Rules list and checks each rule to see if the trigger event in the rule matches the event that just happened. If they match, GroupWise checks the conditions to see if they match the attributes of the item or items affected by the trigger event. If they match as well, GroupWise runs each of the actions in the Then do Actions list. After the actions are run, or if the rule conditions didn't match the item attributes, GroupWise goes to the next rule to check that rule's trigger event and continues the cycle. GroupWise will continue checking each rule in the list until it has processed all of the rules or has found a Stop Processing Rules action in one of the rules (we'll talk about that later). Now that we have the overview, let's write up a plan.

Learning the Rules
The first step, of course is figuring out what you want a rule to do. Move incoming items into folders? Send all advertisements directly to the Trash? Move all items received from Ethan yesterday, that you have already opened, and that contain the words "corporate realignment" to the "Laster Project" folder? You be the judge here. You know what you need. When you know what you want the rule to do, look closely at what needs to happen for the rule to be successful.

First, what action will trigger the rule? Two of the rule examples listed above can act on an incoming message. The Ethan rule, on the other hand, is better triggered when you close the Mailbox or when you exit GroupWise. There are seven possible triggers for a rule; to become better acquainted with them, see the table below. (For further information, check out GroupWise online Help by clicking Help, Help Topics, How Do I, Customize GroupWise, Rules, About Rule Triggers.)

Next, do you want the rule to work on all items, specific types of items, items that contain a certain text string, or something else. The sky's the limit. Once you've picked the items to act on, you've come to the most complex part of creating an effective rule. Fortunately, it is based on the Filter. Yes, the same Filter you use to filter your Item List. And, incidentally, the same one you use to do an advanced Find or filter addresses and groups in the Address Book. We'll get into this portion of creating a rule later. What you need to do now is determine what unique attributes you may need to look for and if the filter is capable of finding them. You may want to brush up on all of the available fields you can use in the Filter. Click Help, Help Topics, Find, then type "rule fields" and double-click About Filter and Rule Fields. There are a ton of fields; you might want to print this topic out and keep it handy for whenever you're creating filters or rules.

Now the fun part. What do you want to do with the item? Again, this is a long list, but nearly anything you can do in GroupWise you can do with a rule. Nearly. This is the satisfying step in creating rules, but it is also an area that can cause a lot of grief. This is where you can have GroupWise send out items without your input. Unless you have thought through all aspects of your rule, you could end up sending your secret recipes to someone in Timbuktu. Or worse, to every living, breathing, coughing inhabitant on the blessed Internet . . . 5,000 times each! You don't want to do that. They get irate and end up calling you at 2:00 in the morning to kindly ask you to get your keister down to the office and delete that offensive rule. Euphemisms optional. So make sure that the action you want is available and consider what side effects the action may cause (loops, wide broadcast, etc.). Just for peace of mind, study what each of the actions does. For the comprehensive list, click Help, Help Topics, Find, type Rule Actions, then double-click About the Actions a Rule Can Perform.

Now that you have an idea of what you want the rule to do, let's start building it.

Build it and it Will Work
Promises, promises, right? Well, to tell you the truth, we can't guarantee that your rule will work the first time, so we'll include some testing and troubleshooting information to help you tune up your rules. That comes later, though. For now we'll go through a sample rule to give you an idea of how to build your own: Your company has just reorganized and the mail clerk has been promoted to CEO and he's looking inside the company for a few good vice-presidents and doesn't want any outsiders; he has asked you to send out application forms to anyone within the company who is interested. You want a rule that sends a message to anyone within the company who includes "Vice-President Application" in the subject. You don't want to reply to Internet messages. So what do you do?

Before we even get into the Rules dialog box, let's get the filter working right. Fortunately, this part is easy to test. You simply create a filter and try it out on your Item List. Open GroupWise and click a folder that has a mix of messages you want the rule to act on and messages you want the rule to ignore. For this example, the Item List should show Internet messages as well as items from within your company.

Now, find an attribute that sets Internet messages apart from the rest. The easy answer is the From address. And the common character in all Internet addresses is "@", right? However, if you have tried the @ symbol, you have probably been disappointed. When you use the Contains function, the Filter thinks that @ is a string delimiter, so it doesn't recognize it as a string. The Matches function works if you want to include Internet addresses (From Matches = *<*@*>), but you can't use the same logic to exclude addresses. Another aspect common to Internet addresses is the domain classification. You know, .com, .org, .edu, and so forth. The problem is that there are about as many domains as there are countries in the world. The one constant is that the e-mails are sent to you. Your GroupWise user ID is listed in at least one of the three address boxes. So try the following filter (with your GroupWise ID where "YourGroupWiseID" appears).Picture

Click OK and only your Internet mail should be displayed. However, this filters Internet addresses in. In our rule we need to filter them out. How to do this is one of GroupWise's biggest secrets. We hate secrets here at Cool Solutions so we're going to blurt it out so all the world can hear: YOU CAN USE A NOT OPERATOR IN THE TEXT BOX! It's that easy. The NOT operator in GroupWise is "!". Oh, and when you're talking in double negatives, always use And. (For example, the To address must not contain "YourGroupWiseID" and the Cc address must not contain "YourGroupWiseID" and the Bc address must not contain "YourGroupWiseID".) So your filter should now look like this:Picture

If the filter is successful, save it. Open the Filter dialog box again, click Filter, Save, type a name, then click OK. We'll use this filter when we create the rule.

Setting the Trigger
Now we get to create the actual rule. (It's about time, don't you think?) Click Tools, Rules, Create, then type a name for the rule. The next step is to select the trigger. For the our rule, since we are replying to messages, we want the rule to run when we receive a New Item. You might pick a different trigger for your rule, however. The following table explains the actions of each trigger and what the side-effects are.


Items it checks

Why to use it

Why not to use it

New  Item

All newly created items including incoming, outgoing, personal, and draft. You can select all of these item types or just one. By the way, if you don't select any, that is the same as selecting all of them.

For moving new items to folders, replying to items, deleting items, forwarding items, and so on.

To act on items that were already in your Mailbox.

Filed Item

The item(s) that are currently being placed in a specific folder.

For a simple way to process one or more items through a rule. It's a drag and drop approach.

This will only process the items that are dropped on the folder. You cannot use GroupWise until the rule has finished processing.

Open Folder

All of the items in a specific folder when you open it.

Helpful if you want to move or delete items from a folder after a period of time or if you want to act on items that are constantly being added to a folder and want to run the rule infrequently.

Since GroupWise needs to process the rule each time you open the folder, you may not want to use the trigger for folders you open often.

Close Folder

All of the items in a specific folder when you close it.

Same as Open Folder, except the changes won't take place until after you have viewed the contents of the folder.

Same as Open Folder.


All of the items in your Mailbox.

Can help you organize your items (move, delete, etc.) without slowing you while GroupWise is open. Good for checking all the items in your Mailbox.

Starting GroupWise is slower. Runs all the items in your Mailbox through the filter, not just those in the Mailbox folder.


All of the items in your Mailbox.

Same as Startup.

Exiting GroupWise is slower. Runs all the items in your Mailbox through the filter, not just those in the Mailbox folder.

User Activated

The selected item(s).

When you want to run a rule on a specific item or group of items.

If you want to run the rule on items that are not selected. It is somewhat cumbersome to click Tools, Rules, Run each time you want to run the rule.

For the Vice-President rule, the trigger is New Item and only Received should be selected.

Conditionally Yours
Now we set up the conditions, or as GroupWise so cleverly puts it, the If Conditions Are (Optional). We'll reply only to mail messages, so select Mail. Then click Define Conditions. Here's our friend the Filter again. Click Filter, Open, whatever you named the filter we created earlier, OK. It should look just as it did when we were filtering the Item List. Now add a new line to the filter by clicking the End button and choosing And. Make this line "Subject Includes [ ] Vice-President Application END". This ensures that the rule replies only to those people writing about the application. Now click OK. We're done here for now. However, we'll return later to give hints on preventing loops and avoiding inadvertent responses.

Where the Action Is
We are creating a potential for disaster in the Vice-President rule. Whenever you create a rule that sends out a message you have the possibility of a loop. This threat is greater when you send anything out through the Internet to an address that could create an automated reply, such as a list server or another e-mail system that supports rules, such as GroupWise. Inside your GroupWise system, GroupWise can monitor items and track down loops. They won't go past three cycles. However, when an item goes out to the Internet, the tracking is lost and GroupWise can no longer determine if those messages you're receiving and sending are intentional or an automated mistake. So let's be a bit conservative when putting in the actions, and maybe adjust our filter a little to catch any other threats.

Our rule sends out a reply, so click Add Action, Reply. In the Reply dialog box, make sure that Reply to Sender is selected. Replying to everyone can create a big mess if the item is addressed to a group, especially if members of the group have vacation rules. The result can be the e-mail version of an atomic explosion. Let's avoid that. You can select to include the original message text, but there really isn't a reason to here. Click OK. Now insert the text for the form you have prepared to send to employees, or you can include your file as an attachment. Now click OK and let's tighten up the security of the rule.

Ruling Responsibly
There are more things you can do to make your rule nearly bullet-proof. Here are some examples that you might use in your rules but that don't necessarily apply to our sample rule.

"Subject Contains [ ] !Re:" prevents you from replying to a reply, and therefore getting sucked into a loop.

"To Contains [ ] Your GroupWise Name" prevents the rule from replying to messages sent to a group. This actually could be useful in our sample rule. For example, Corporate Communications might send out annoying announcements that contain the same text your rule checks for, and you don't necessarily want to send the application forms to them.

"To Matches = !List server Name" prevents unintentional replies to list servers. List server subscribers take a dim view of automated replies to their list server.

Rules and Lines
The last step in this process is to decide where you want your rule to show up in the Rule List. You may think that alphabetical is good enough, but you could be wrong. Rules execute in the order they're listed, so actually they're all lined up like children filing into a bus: get the wrong two together and you may get bad results; or put a group of talkative friends together and you might stop the entire progression. You get the idea. Having your rules lined up lets you link rules to accomplish more complex tasks. It can also give you the power to stop subsequent rules from processing.

For example, say you reply to messages sent by Mark with a reply pledging your eternal love. You reply to messages with "Snookums" in the subject with a reply to Martin that he is the hunkiest hunk in the world. So what happens when Mark sends a message with the subject "To my most beautiful Snookums"? Chaos, that's what. Because Mark doesn't like to be called Martin. So, put Mark's rule first and add the action "Stop Rule Processing" to it. That way he will only receive one reply and you can keep up your automated juggling act.

By the way, our Vice-President rule should go near the top of the list so that there is less of a chance that it will be affected by other rules. If you have other rules that you don't want running while you are gone, add the Stop Processing action to the end of the rule and put only those rules you don't want running below it in the list.

Testing and Troubleshooting
Always test a rule before you turn it loose on the world. You should be able to test many of your rules without trouble. The best place to start is with the Filter. If you can define a filter that shows only the items you want the rule to manipulate, you're 75 percent of the way there (okay, that statistic is made up; but you'll find it is much easier to test a filter than it is to test a rule). As we've said before, save that filter and plug it into your rule. (Do you get the feeling that the filter is important?)

After you have the filter lean and mean and performing as you want, testing your rule may be a matter of sending items to yourself and seeing what happens. Sending to yourself provides a closed environment that keeps any loops you may have produced safely within your own Mailbox. Along those same lines, if you are testing a rule that sends a message to someone, have the rule send it to you while you test it so you can work out any of the kinks without irritating anyone else.

Another quick way to test a rule is to select an item that should trigger an action from your rule, then click Tools, Rules, Run. You will get an immediate prompt telling you whether the rule was successful or unsuccessful, then you can look in your Mailbox to see if the action was executed properly.

It also helps to consult others who have had experience with rules and filters. Below you'll find questions we've received from readers along with their corresponding answers. Hopefully you'll find something in the answers that will help you too.

Rules Q&A
Guruprasad S. wrote: Hi, I am a developer at Novell IDC, Bangalore, India. I have an enhancement suggestion for a Rule to archive mails selectively: currently there is no provision to set up a rule to archive mails. If archive is also added as one of the actions in the New Rule dialog, then we can create rules to selectively archive mails after the expiration of the number of days set in the Autodelete option. One advantage with this is we need not have to go through autodeleted mails to see if any important mail is there and then archive it.


Marc S. from Neuss/Germany wrote: Hello experts, I would like to know whether there is a way to set up different archiving rules for different folders. Our problem is that we would like to keep our rule that all messages are archived after 30 days, but we want this to apply only to the Cabinet and not to the Mailbox, Calendar, etc. because most of our users prefer to use the Mailbox as a place where they have instant access to all messages that are 'up to date' for them (meaning: messages that still are important for their daily work). Once they don't need them any longer on a daily basis (as a reminder), they either delete or move them to the Cabinet. If there is no possibility to do this in the 'Options' menu, could it be done by setting up a rule that automatically archives messages when they are moved to the Cabinet?

To understand why Rules treats Archive the way it does, you need to understand that Rules are server-based, meaning that they work even when you are not using GroupWise. This makes it possible for you to create a vacation rule that works while you are soaking in the sun on the beach while your computer is far away, gathering dust, and-- turned off. That said, there are also triggers that require that your machine be turned on, with the GroupWise client running, such as Startup, Exit, Open Folder, Close Folder, and User Activated. When you use one of these triggers you can choose Archive from the Add Action menu. So, Guruprasad, Archive isn't missing, it's only hiding.

Marc, unfortunately, Filed Item is not one of the Archive-capable triggers. Here are a couple of work-arounds, although neither is a perfect solution:

1. You can have your users create a rule that uses Open Folder as a trigger. When they open the folder, all items over 30 days old are archived. The problem with this rule is that opening the folder can take longer than they are accustomed to.

2. You can have your users create a couple of rules to run in succession. The first uses the trigger Filed Item. When a user moves a message into a folder, the item is marked Private. The second rule is triggered by Exit. It archives all items that are marked Private that are over 30 days old. The drawback is that in this case Private is not being used as it was intended. Now, we don't care about can use Private to mean whatever you want.  However, if a user is using Private to control proxy access, this rule would be intrusive.

Michael H. from Tucson, Arizona, USA wrote: I'm a Network Systems Engineer working for the city of Tucson, Department of Transportation. I've been a CNE for over six years and have one more exam to pass for my MCNE. My question is: Is there any way I can create an action under Rules?

My problem is: I have a rule that will move certain unopened mail receipts into a directory so I can check who accepted/declined a meeting. At this point my mail is always showing new mail because the rule states unopened. I want the mail receipts to move into the directory, then open and close so I don't have new mail showing. How's this for a challenge? Thanks for any help :)

Michael, we're always up for a challenge, and Rules is a good place for it. We have bad news and good news. Bad news: you can't create actions for Rules. Good news, bordering on great, you don't need a new action because Mark as Read is already in the list. Make it the last action that happens to the item after it is moved to the folder. Your rule should come out looking like this:


Dennis wrote: When a rule is set to send a copy of all sent and all received items to another person's Mailbox, everything appears three times. Do you have any idea what might be the cause of this? I have tried to delete and recreate the rule and checked the other user's machine for any type of rule that would cause a loop to occur, etc. (tried the basics first). Thank you.

Dennis, as you assumed, the fact that you get everything three times is a good indication that you have a loop going on. Sending a copy of items you are sending is an easy way to get a loop going. For example, your rule is probably checking for a specific string in the subject. When it finds the string, it forwards a copy to Whoji, your supervisor. Well, what does the rule do when it sees that same string in the subject of the new, forwarded message going out to Whoji? It sends another, of course. It keeps doing that until GroupWise gets fed up and swats the rule on the nose with a newspaper. One way to prevent this little battle is to add a line to your conditions filter:

And Subject [ ] !Fwd:

This may or may not work for you depending on if any of the mail you need to forward to Whoji is already being forwarded. Hope this helps you out.

Arnie M. wrote: I've followed the directions in the article about creating rules for resources to auto-accept appointments and auto-reject conflicts. Both events are firing, even when it is clear that there is another event scheduled. I've even moved the Reject rule up so that it is first.

Arnie, it's hard to troubleshoot this rule without seeing it. Our guess is that you have not selected the correct option under Appointment Conflict Exists. For the Reject rule you should select Yes. We suspect that you currently have selected Yes and No (Doesn't Matter). If that isn't correct, send us a screen shot of the rule and we'll try to sort it out for you.

Dennis B. wrote: I have a rule that will auto-reply to the sender when the subject contains "Send FF7 File." I set this rule up to automatically send this file to the author of the note I receive. However, it looks like it pulls the file from my hard drive and stores it somewhere in GroupWise which means as soon as I change the file the auto-reply is out of sync. Is there a way for GroupWise to set up this rule for use on a dynamic file?

Because GroupWise Rules run from the server, there is no way for GroupWise to take the file from your hard drive. Currently there is no way to send a dynamic file, even if it resides in the Library. Sorry, Dennis.

Judy O. wrote: Can a rule be set up to send a copy of mail received in GroupWise 5.1 to your AOL mail (whereby being able to view it from both places)?

Sure, Judy. All you need to do is have GroupWise forward all your mail to your AOL account through the Internet. It should look something like this:


Thomas S. wrote: Good Morning, Experts :) In WPO41 I used to set up rules to send an automatic reply to incoming messages when I was away from the office. However, the rules were somewhat complex because I used filters to avoid sending a reply when
a) a message was addressed to the group Everybody, Staff, or Helpdesk
b) a message came from the outside (sender contains SMTPGW)
c) a message came from a mailing list (sender started with L)

The problem I see with GW51 is that the conditions can apparently not be negated, e.g. "does not contain" or "does not begin with." I assume I can work around this issue by breaking up a rule into multiple ones and installing positive conditions that "stop rule processing." However, this setup would become very complex, as I also have some rules that are on all the time, e.g. automatically delegate Internet Link Problems ;) to my assistant or kill certain cartoons I receive daily. To make a long story short, is there a way to use a "not" in a GW51 rule condition?

Thomas, conditions can be negated, but unfortunately we haven't clarified that in the past. For some mysterious reason, the NOT operator is not in the pop-up menu in the filter. As we mentioned earlier in this article, you need to type it into the field following the Contains or Equals operator. For example "From [ ] !Everybody".

Elizabeth N. wrote: I am pretty darned good at creating rules in GW5.1, but I cannot for the life of me create a working rule for the receipt of Internet E-mail. I have tried creating rules based on the From field containing @ or the To field containing my Internet E-mail addresses, but no luck. Am I totally off base here? Thanks in advance.


David N. from Salt Lake City wrote: I'd like to move all noncompany e-mail to a specific folder via a rule when it is received. I have tried to set up a filter to Move to Folder where 'From' contains [] @. When this filter is applied it filters everything! How can I filter on nonalphanumeric characters on the From field?


Shelley from University Library  Lethbridge wrote: I use rules to forward incoming mail but discriminate by subject line. Worked fine on old GroupWise (4.1) but now (5) seems to be caps and punctuation sensitive--i.e. won't work with a subject line that has either. O.K., here's what I ask GroupWise to recognize: new item, incoming mail, if item contents are subject :

UnCover Reveal - Journal of Software Smarter Than Me/I.

The rules grab this mail, forward it to interested souls, and empty it from my In Box. What my rule now looks like is this:

*over *eveal *ournal of *oftware *marter *han *

Is there a fix?

This problem was explained a bit earlier in the article, but we'll go into a little more detail here. There are three functions that you can use to search in a field such as From or Subject: Contains, Begins with, and Matches.

Contains really means "Contains Word." It breaks the strings down into individual words and then tries to match your word to a word in the field. So if you type "Sasquatch" in the filter, it will locate all occurrences of "Sasquatch" but not "Sasquatches." (To find both, type "Sasquatch*".) To be able to identify individual words, the filter needs delimiters--spaces or characters that go between words that mark the end of one word and the beginning of another. Unfortunately one of these delimiters is @. And because a delimiter cannot be a word and a word cannot contain a delimiter, @ cannot be found using Contains. For this same reason, Shelley, your problem doesn't involve case-sensitivity at all. Rather, the dash is another delimiter. If you remove it and put in the asterisks, the rule will work fine.

Begins with matches the string you type in to the first letters of the first word in the field. This is great for finding forwarded messages (Fwd:) or replies to messages (Re:).

Matches only finds the text you type in the filter if it is exactly the same as the entire text in the field (except it is not case sensitive). Wildcards are very helpful with Matches. And Matches is very helpful for finding delimiters, such as @. For example, to filter in Internet messages, match the following in the From field: "*<*@*>".

Rene M. wrote: I love your web site. I visit your site at least three times a week to obtain informative information about GroupWise 5.1.

Today, I was trying to create a rule in the 32-bit client that will not reply to incoming messages from Internet mail. I cannot find a NOT operator in the Define Conditions FROM field that will include an exclamation (!), then @. Please help me define this rule in the 32-bit client of GroupWise 5.1. As always, thank you for your assistance & keep posting those informative tips, feature articles and Q&A sections. HAPPY DISCOVERING!

Renee, we're glad that you find our information informative and hope this article has been just as informative. Now that we have the Contains, Starts with, and Matches information out of the way, and have introduced you to the NOT operator (!), we can work on making everything negative. For some reason Matches doesn't like NOT. For that reason you need to go back to Contains and its limitations. There are a number of ways to identify Internet messages. There is, of course, the method described in the article. However, if you receive messages from a wide array of domains (such as we do) you might end up with a very large filter. Here are some other suggestions:

1.  From Contains [ ] !*.* END (If your organization doesn't allow periods in its internal addresses, this is the quickest to exclude Internet addresses.)

2.  To Contains [ ] !YOURGWID END (YOURGWID is where you insert you GroupWise ID, such as SBChristensen. Your GroupWise ID shouldn't appear in any of the address fields unless you receive an Internet message or some joker enjoys using it to address messages to you.)

3.  Attachments Contains [ ] !YOURGWID END (Every Internet message should include a header file that contains information about the message. One piece of information is your Internet address, which includes your GroupWise ID.)

There are other attributes you can use to identify and exclude Internet messages with, but these are probably esoteric enough for our purposes. If you can find one that always works and is easy as pie, send it to us and we'll disperse it for everybody's benefit.

Gordon B. wrote: We currently are using GroupWise 4.1a to send and receive e-mail. I have a user who is out of the office for the next three months on maternity leave. Can I configure her client to either reject incoming mail or to automatically send an e-mail response to senders telling them that she will be out of the office until further notice. How do I do this?

Gordon, you can use many of the suggestions outlined in this article and customize them for GroupWise 4.1.

David S. wrote: I have defined a series of rules to file my received e-mail in folders. These rules all worked fine in 4.1, but in 5.1, they only seem to apply to messages created by someone, not replied to. My rule specifies New items where from contains (for example) "David Simmons" then links the message to a specific folder. Is there something different in 5.1 that causes this type of rule not to work properly, and if so, is there a solution to the problem? Thanks for your assistance!

David, without more information it's hard to say why your rule is going awry. Our suggestion is that you create your filter outside your rule and try it out on your Item List. When you can filter in only those messages you want, then insert it into your rule.

Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions.

© Copyright Micro Focus or one of its affiliates