Skip to main content


ec_rewrite_mailfrom — change the envelope sender


ec_rewrite_mailfrom { address } [ counter ]


This action will replace the envelope sender (the MAIL FROM) address on the envelope with the one supplied. The headers and the body of the message will not be changed.

The optional counter parameter to ec_rewrite_mailfrom 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.

Sieve scripts using ec_rewrite_mailfrom can be set during data_phase1 or any subsequent phase except the set_binding_phase.

if envelope :domain :is "from" "" {
  ec_rewrite_mailfrom "";
Was this page helpful?