# Filtering Mail with Sendmail

## Introduction

Sendmail's Content Management API (milter) provides third-party programs to access mail messages as they are being processed by the Mail Transfer Agent (MTA), allowing them to examine and modify message content and meta-information. Filtering policies implemented by Milter-conformant filters may then be centrally configured and composed in an end-user's MTA configuration file.

Possible uses for filters include spam rejection, virus filtering, and content control. In general, Milter seeks to address site-wide filtering concerns in a scalable way. Individual users' mail filtering needs (e.g. sorting messages by subject) are left to client-level programs such as Procmail.

This document is a technical introduction intended for those interested in developing Milter filters. It includes:

- A description of Milter's design goals.
- An explanation of Milter application architecture, including interactions between the support library and user code, and between filters and the MTA.
- A specification of the C application programming interface.
- An example of a simple Milter filter.

## Contents

- Architecture
  - Design Goals
  - Implementing Filtering Policies
  - MTA - Filter communication
- Technical Overview
  - Initialization
  - Control flow
  - Multithreading
  - Resource Management
  - Signal Handling
- API Documentation
  - Library Control Functions
  - Data Access Functions
  - Message Modification Functions
  - Callbacks
- Installation and Configuration
  - Compiling and Installing Your Filter
  - Configuring Sendmail
- A Sample Filter

Copyright (c) 2000, 2001 Sendmail, Inc. and its suppliers. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the LICENSE.