ec_action

March 26, 2020 Contributors

Name

ec_action — set SMTP status code

Synopsis

ec_action { smtp-code } { reason } [ counter ]

Description

This action will issue the provided SMTP code and reason to the remote MTA. Multi-line reasons may be provided; each line will be prefixed with the SMTP code for you automatically.

The optional counter string is used to count the number of hits for this particular action; if omitted, the script filename and line number will be assumed. You can see the hit count via the web console or via ec_console using the sieve stats command.

require "ec_action";
if envelope :domain :is "from" "bad-guy.com" {
  ec_action 550 "5.7.1 We don't want mail from %{spfv1:p}";
}
REMOTE > MAIL FROM:<[email protected]>
LOCAL > 550 5.7.1 We don't want mail from mta01-ft.bad-guy.com

This is a terminal action; no further Sieve rules will be run for the current message in the current phase.