E-mail filtering is a crucial part of any modern mail server system. Filtering serves various purposes including the management of incoming and outgoing messages, blocking or flagging spam, removing viruses from attachments, automating organization of messages, and implementing various user-defined rules for message handling. Effective filtering is essential not only for the organization and security of the mail system but also for user productivity and the overall quality of the email experience.
📄️ Sieve scripting
Sieve is a scripting language used to filter and modify email messages. It provides a flexible and powerful way to manage email messages by automatically filtering, sorting, and transforming them based on a wide range of criteria. Rather than relying on a proprietary DSL, Stalwart SMTP uses Sieve as its default scripting language primarily because it is sufficiently powerful to handle most filtering tasks and is an established internet standard.
📄️ Milter filters
Milter, or "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. By using Milters, a mail server can utilize a variety of functionalities such as spam filtering, virus scanning, and other types of mail processing, beyond what is built into the mail server itself. Milters operate at the SMTP protocol level, which means they have access to both the SMTP envelope and the message contents.
Stalwart SMTP supports filtering messages using external executable files, referred to as "pipes". Pipes operate by receiving the email message through standard input (stdin), processing or modifying it as required, and then returning the adjusted message via standard output (stdout).
DNS block lists (DNSBLs) are databases of IP addresses and domain names that are associated with malicious or unwanted behavior on the Internet. They are used as a tool for blocking incoming email from known spam sources. Stalwart SMTP can be configured to use DNSBLs to check the IP address and domain name of the sender of an incoming email, and if they are listed in one of the DNSBLs, the email is rejected. DNSBLs are maintained by various organizations and are updated in real-time to reflect the latest information about spam and malicious activity on the Internet.