The events defined for the SMTP filter and their contexts are:
onConnect
— SMTPIn eventonEhlo
— SMTPIn eventonMailFrom
— SMTPIn eventonRcptTo
— SMTPIn eventonHeadersReceived
— SMTPIn eventonDataReceived
— SMTPIn eventonRelay
— SMTPOut eventonDeliveryFailure
— SMTPProc eventonTemporaryDeliveryFailure
— SMTPProc event
Thus, the structure of the script file is:
For example, the following code will be applied on the onConnect
event and will reject connections from the remote IP 1.2.3.4
with an explanation:
Another example applied on the onRcptTo
event:
The above rule will be applied when the RCPT TO
command is given during the SMTP communication. If the recipient's domain is example.org, the message will be relayed to the IP address 1.2.3.4
.