Overview
Email filtering is an essential part of any modern mail server. Filtering covers the management of incoming and outgoing messages, blocking or flagging spam, removing viruses from attachments, automating the organisation of messages, and implementing user-defined rules for message handling. Effective filtering protects the security of the mail system and supports user productivity.
Spam filter
Spam filtering is an essential component of any modern mail server, designed to identify and segregate unsolicited or potentially harmful messages from the legitimate mail flow. Unsolicited messages (spam) clutter mailboxes and can pose significant security risks; efficient spam filtering ensures that genuine messages reach their recipients while unwanted or malicious ones are quarantined or discarded.
Sieve scripting
Sieve is a scripting language for filtering and modifying email messages. It provides a flexible way to manage mail by automatically filtering, sorting, and transforming messages based on a wide range of criteria. Stalwart uses Sieve as its default scripting language because it handles most filtering tasks and is an established internet standard.
Milter filters
Milter, short for "mail filter", is an extension to mail servers based on the Sendmail protocol. Milters allow third-party software to access mail messages as they are being processed in order to filter, modify, or annotate them. Through milter, an MTA can add functionality such as spam filtering, virus scanning, and other kinds of message processing. Milters operate at the SMTP protocol level, so they have access to both the SMTP envelope and the message contents.
MTA Hooks
MTA Hooks provide an alternative to milter for managing and processing email transactions. Instead of a custom binary protocol, MTA Hooks use HTTP with JSON request and response bodies, making integration and debugging simpler.