Skip to main content


ec_action — set SMTP status code


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


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" "" {
  ec_action 550 "5.7.1 We don't want mail from %{spfv1:p}";
LOCAL > 550 5.7.1 We don't want mail from

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

Was this page helpful?