University of Southern California

ITS Information Technology Services

A division of the Office of the Chief Information Officer

Examples of Elm Filters

  1. To file all messages from ttrojan@usc.edu (where ttrojan is a sample user) in the local mail folder from_me:

    if (from = "ttrojan@usc.edu") then save /home/scf-00/ttrojan/mail/from_me

    Note: The path leading up to your local mail directory can be determined by running the command pwd once you are in the mail directory. The path will be different than that specified in the example.

  2. To delete all messages from the domain spam.com:

    if (from contains "spam.com") then delete

  3. To forward messages that do not have the subject "Work" to ttrojan@hotmail.com and keep a copy in the Inbox:

    if (subject != "Work") then forwardc ttrojan@hotmail.com

  4. To allow messages sent to innocuous_list (where innocuous stands for the name of a mailing list to which you wish to subscribe) to be delivered normally:

    if (to contains "innocuous_list") then leave

  5. To delete messages longer than 10,000 lines:

    if (lines > 10000) then delete

Validating Filters

Once filters have been specified, they can be validated by running the command filter -r at the prompt. This will cause the filter program to parse the .elm/filter-rules file and display the conditions and actions it has associated with each rule.

If the filter program interprets a rule differently than was intended, the .elm/filter-rules file should be examined to verify that the conditions and/or actions are specified properly.

Getting Help

More information about Elm filters, as well as additional commands for the filter program, can be viewed by running the command "man filter" at the UNIX prompt.

The Customer Support Center can assist you with setting up filters for your mail. However, consultants will not extensively troubleshoot filter rules, nor can they assist users who need finer rules than Elm filters allow or who need to get a specific program to work--either as part of a filter rule (execute or executec) or to perform the filtering itself.

Users requiring assistance can either call the ITS Customer Support Center at 213-740-5555, or send an email to consult@usc.edu.

Last updated:
August 03, 2007

Email Help

The use of all USC computing resources is governed by the USC Computing Policies.