Objective 3: Managing Mail Traffic

Filtering and sorting mail can be accomplished in many ways on a Linux system. Solutions include:

Procmail is one of the older solutions but is explicitly covered by the LPI Exam. Therefore, it warrants the discussion in this section.

Filtering and Sorting Techniques

Before you learn more about Procmail, it is important to understand the basics of how mail is filtered and sorted. Filtering mail requires the application to read messages and determine the parameters given in Table 36-5.

Table 36-5. Filtering techniques

Parameter

Description

The From field

Information concerning the host and user who sent the message

The To field

Information concerning the host and user intended to receive the message

The Subject field

The field that endusers enter to describe the message

Message body contents

Can include text as well as indicators of the document format (e.g., ASCII or HTML)

Once the filtering parameters are determined, messages can be sorted and processed in many ways, including:

  • Forwarding the message to a remote host

  • Issuing an autoreply, a useful option for messages indicating a prolonged absence (e.g., a vacation)

  • Storing the message into a custom directory

  • Deleting the message, often by sending the file to the /dev/null file

You will need to know how to identify the contents of Subject, From, and To fields, as well as the ...

Get LPI Linux Certification in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.