SMTP Events

Axigen Documentation

The events defined for the SMTP filter and their contexts are:

  • onConnect — SMTPIn event 

  • onEhlo — SMTPIn event

  • onMailFrom — SMTPIn event

  • onRcptTo — SMTPIn event

  • onHeadersReceived — SMTPIn event

  • onDataReceived — SMTPIn event

  • onRelay — SMTPOut event

  • onDeliveryFailure — SMTPProc event

  • onTemporaryDeliveryFailure — 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.