HPlogo Sendmail 8.13.3 Programmer's Guide: HP-UX 11i v1 and HP-UX 11i v2 > Chapter 1 Introduction

Milter Overview

» 

Technical documentation

Complete book in PDF

 » Table of Contents

Sendmail 8.13.3 contains an advanced and effective mail filtering facility called Milter, which stands for Mail Filter. Milter is both a protocol and a library. Milter APIs provide an interface for third-party software to validate and modify messages as they pass through the mail transport system. Milter APIs enable filters to “listen in” to the SMTP conversation and modify Simple Mail Transfer Protocol (SMTP) responses.

To modify aspects of the message, you can call the Milter library functions that send special messages to Sendmail. The Milter library is multi-threaded and a given Sendmail installation can have multiple mail filters. Sendmail is single threaded but it forks into multiple processes. Sendmail uses mail filters to filter incoming SMTP messages.

Milter APIs provide the following benefits:

  • Safety and security - You do not need root user privileges to run the filter processes. This feature simplifies coding and limits the impact of security flaws in the filter program.

  • Reliability - Any failure in the Milter program does not affect Sendmail. When the Milter program fails, Sendmail either considers that the Milter program does not exist or considers that the required resource is unavailable.

  • Simplicity - You can use Milter APIs to easily implement filters in Sendmail. To make the implementation easy, you can use threads by defining thread-clean interfaces that include local data hooks.

  • Performance - A simple Milter program does not degrade the performance of Sendmail.

Following lists the types of Milter APIs:

  • Library control functions

  • Data access functions

  • Message modification functions

  • Other message handling functions

  • Callbacks

Milter APIs operate in the following phases:

  • At various stages of the SMTP conversation, Sendmail sends a message over the socket to the Milter program.

  • The Milter library invokes a callback into your code and sends a reply message to Sendmail containing the return value from your callback.