Alerts Option

Alerts are user-specified commands that run when incoming mail arrives. The Alerts ... option invokes a specific command when incoming mail containing a certain string pattern in its header arrives. You can specify a different string pattern for each command you define. When mail arrives, the headers are scanned for a match with any of the patterns. When a match is detected the associated command is executed.

The alert command can be any executable program. You can specify the program's full path name, or your $PATH environment variable is used to find the program.

You can pass the message headers and/or the message body to the alert command. If %m is added to the command, Ishmail will create a file with the entire message contents and replace %m with the name of that file. %h will be replaced with the name of a file containing just the message headers. %b will be replaced with the name of a file containing just the message body. %% will be replaced with %. Here is an example command that will display the Subject: and From: headers in a new message using the mfyi command:

mfyi -center "`egrep `^(Subject:|From:)' %h`"

Possible uses for alert commands include:

To add or insert new alerts, and to edit or delete existing alerts, click the Alerts ... option. The Alerts dialog window appears.

Figure: Alerts Window

Specifying Alerts

The Alerts dialog window shows the list of current string patterns and associated commands in a box containing two text fields - the Pattern name field and the associated Command field. (If no alerts have been defined, both fields are empty). Each pattern must have a command associated with it.

Each pattern is evaluated as a regular expression, as defined by the UNIX ed command.

The Enable Alerts button in the upper right corner of the Alerts window lets you temporarily disable all alert commands without having to delete them.

You use the four buttons to the left of the text fields to:

When you click the New ..., Insert ... or Edit ... buttons, the Edit Alert Rule window appears. It contains text fields in which you can create or modify an alert.

Figure: Edit Alert Rule Window

Creating a New Alert

New alerts are added to the end of the list. Since patterns are evaluated in order, this means that the newest alert pattern is checked last. To create a new alert:

  1. Click the New ... button. The Edit Alert Rule window appears.

  2. Place the pointer in the Pattern: text field and enter a string pattern that would appear in the header field of an incoming message.

  3. Place the pointer in the Command: text field and enter an associated command that will be invoked when the string pattern is encountered in a message header.

  4. Click Ok or Apply in the Edit Alert Rule window. The new alert is added to the end of the Pattern list.

Inserting an Alert

Since patterns are evaluated in order, inserting an alert ahead of other alerts causes its pattern to be evaluated first. To insert an alert:

  1. Select an alert in the Pattern list and click the Insert ... button. The Edit Alert Rule window appears.

  2. Place the pointer in the Pattern: text field and enter a string pattern that would appear in the header field of an incoming message.

  3. Place the pointer in the Command: text field and enter an associated command that will be invoked when the string pattern is encountered in a message header.

  4. Click Ok or Apply in the Edit Alert Rule window to insert your changes before the selected alert in the Pattern list.

Editing an Alert

To edit an alert:

  1. Select an alert in the Pattern list and click the Edit ... button or double-click the alert. The Edit Alert Rule window appears with the alert pattern and associated command in the text fields.

  2. Make your modification(s) in the text fields.

  3. Click Ok or Apply in the Edit Alert Rule window to add your changes to the selected icon in the Pattern list.

Deleting an Alert

To delete one or more alerts:

  1. Select the alert(s) you want to remove.

  2. Click the Delete button.

    A pop-up confirmation box prompts you for confirmation before completing the operation.

Applying Your Changes

Apply or cancel your changes using the row of buttons across the bottom of the window. See Applying Your Changes.


Preceding Section: Aliases Option
Following Section: Icons Option
Parent Section: Main Window Options Menu
Contents of Ishmail User's Guide