Lesson 1
Using Linux procmail
As of September 2021, Procmail, a mail processing utility for Unix-like systems, is considered deprecated and unmaintained. Although it is still in use in some legacy systems, it is not recommended for new installations due to potential security vulnerabilities and a lack of updates.
Red Hat, the company behind the popular Red Hat Enterprise Linux (RHEL) distribution, officially deprecated Procmail in RHEL 7 and removed it from RHEL 8. The deprecation notice is available in the official RHEL 7 documentation:
For mail filtering and processing needs, it is recommended to use alternative tools and utilities, such as:
- Sieve: A powerful and flexible mail filtering language commonly used with the Dovecot IMAP server. Sieve scripts can be used for server-side mail filtering and organization.
- Maildrop: A mail delivery agent (MDA) with its filtering language similar to Procmail's, but with additional features and a more modern implementation.
- Milter: A family of mail filtering tools that work with the Sendmail and Postfix mail transfer agents (MTAs). Milters can be used to filter and process mail during the SMTP conversation, allowing for greater flexibility in mail processing.
When choosing an alternative to Procmail, consider the features and integration with your existing mail server infrastructure, as well as the community support and ongoing development of the tool.
Procmail is Linux's standalone email processor. With
procmail
, pronounced
prock-mail, you can automatically filter and file your email, based on the body of your incoming emails or their
delivery headers[1]. This capability allows you to automatically file
messages you're not interested in seeing, such as
SPAM[2]. In this module, you will learn about procmail and how to configure and invoke it. You will also learn about
procmail
's
recipes, which form the basis of
procmail
's filtering
capabilities, and how to test and troubleshoot your own recipes.
Learning objectives
After completing this module, you will be able to:
- Describe
procmail
and its use
- Configure
procmail
- Compare condition and action flags
- Identify recipe conditions
- Describe recipe actions
- Invoke
procmail
- List techniques for filtering mail
- Test
procmail
filters
- Troubleshoot
procmail
The next lesson describes
procmail
and its use.
Delivery Headers used in procmail of Red Hat Linux
[1]Delivery headers: Routing and control information found at the beginning of every email. Common headers include the destination (the "To:" header), the sender (the "From:" header), and the subject (the "Subj:" header).
[2]
SPAM: A common name for unsolicited email, named after a Monty Python sketch.
Recipes: A concise set of procmail instructions that filter or otherwise manipulate an email.