Configuring autoforward sender address

Customer would like to have auto forwarding feature as described below:

  • Scenario: (User A -> User B (Auto forwarder) -> User C)

  1. is an App Suite user at cust.

  2. An email is sent from to

  3. set an auto-forward rule so emails are being forwarded to automatically.

  4. received the forwarded mail.

  • Current behavior:

    The mail received by has mail from header

    (i.e. the mail from is unchanged by OX App Suite when forwarding to user C)

  • Requested behavior:

    The mail received by has mail from header

    (i.e. the mail from has been changed by user B (OX App Suite in customer) when forwarding to user C, so the mail looks like as if it was originally sent by user B)

  • Reason for the request:

    Currently, the mails being auto forwarded by user B are occasionally get failed to pass SPF check somewhere in the path, which will result that the mail cannot be forwarded to user C.


Sieve needs to have

plugin {
  # Use editheader
  sieve_extensions = +editheader

The following is an example of what the Sieve rules could look like:

require "editheader";
require "variables";
require "envelope";

# ... Any other rules

# Obtain the user's full email address somehow
# It can be obtained from the recipient address (without full name)
# An alternative is to put the primary address into the script as a literal.
if envelope :matches "to" "*" { set "user_email" "${1}"; }

# This part of the script MUST be the final rule, otherwise other rules are
# affected since the message is modified.

# Drop the original "From:" header
deleteheader "from";

# Add a new "From:" header
addheader "From" "${user_email}";

redirect "";


It is very important to make that deleteheader, addheader, redirect the last rule in the sieve script, as this would affect other actions as well