Message Flow Policies (smtpFilters.script)

Axigen Documentation

The Axigen SMTP Policy system is defined in a single file per installed Axigen mail server and has events for the SMTP Incoming, Outgoing, and Processing stages of a mail lifecycle. The Policy system contains Message Acceptance Policies and Processing and Relay Policies. The file is known by the server by the means of the smtpFiltersFile parameter.

Changing the existent rules / methods or adding new rule / methods by directly editing the smtpFilters file is NOT recommended for normal usage. This could render unavailable in the corresponding context of SMTP filters / rules in WebAdmin and it is not advisable unless you need heavy tweaking and know what you are doing.

Instead of directly editing smtpFilters, for normal usage, the administrator should use the following context from the WebAdmin module: Security & Filtering → Acceptance & Routing.

If the specific WebAdmin context is invalidated by manual modifications of the smtpFilters file, then a warning will be displayed, and the user will be presented with the opportunity of overwriting the contents of the file.

Since manual modification of the smtpFilters file is not recommended, a wizard that will help you build your required rules is available in WebAdmin.

 If rules already exist in the smtpFilters file, using the wizard from WebAdmin will overwrite all of them, so please first back-up your smtpFilters file.

The events defined for the SMTP filters and their contexts are presented below:





SMTP Incoming

Called when a new client is connected.


SMTP Incoming

Called after receiving the EHLO message sent by the client.


SMTP Incoming

Called as a result of the MAIL FROM command issued by the client.


SMTP Incoming

Called as a result of the RCPT TO command issued by the client.


SMTP Incoming

Called after the message header is received.


SMTP Incoming

Called every time a piece of the mail body is received.


SMTP Incoming

Called after receiving the message successfully through the DATA or BDAT commands.


SMTP Outgoing

Called before establishing a relay connection in order to determine the connection parameters.



Called when the mail delivery failed for a certain group of recipients.



Called when the mail delivery has temporarily failed for a certain group of recipients.

This language defines a scripting language to be used especially for SMTP filtering. The SMTP process has three different contexts: Incoming, Outgoing, and Processing. Thus, the behavior of the same filter differs depending on the context to which it is applied. For example, the SMTPIn events are triggered only within the SMTP Incoming context.

The message flow is always presented from the Axigen perspective. In other words, the SMTP Incoming context refers to any message that is received by Axigen from any remote host, client, or another server. Decisions are made upon the received message on every event. The SMTP Outgoing context refers to messages sent from the Axigen machine to a remote host also using SMTP (Simple Mail Transfer Protocol).