Can the admin create an account with redirect?

Hi,

I need to create multiple email addresses that automatically forward incoming messages to other addresses.

For example:

Here’s what I’m currently doing:

  1. Create a new account (with a password) in the admin dashboard.
  2. Log in to the newly created account.
  3. Add a Sieve script to redirect incoming emails.

Is this the right approach, or is there a simpler way to achieve this?

I know Stalwart supports groups and mailing lists. Is there a similar feature for simple email forwarding without having to create a full account for each address?

Thanks!

Yes. Stalwart handles this with a Sieve script on each account. You create the account ([email protected]) as usual, then give it a script that redirects its mail to the external address.

To forward everything to Gmail and drop the local copy, the script is:

redirect "[email protected]";

To forward a copy and keep the original in the Stalwart mailbox, use:

require ["copy"];

redirect :copy "[email protected]";

Plain redirect forwards the message without storing it. redirect :copy forwards and also keeps it.

Stalwart doesn’t rewrite the envelope sender when it forwards. The forwarded message keeps its original sender, so Gmail may reject some of it because of SPF or DMARC checks.

I didn’t find a documented bulk way to create many accounts with redirects. For a large number, you could script account creation with stalwart-cli. I haven’t confirmed how to attach a Sieve script to an account from the CLI, so I won’t guess at the commands.

Docs:

This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong.

A mailing list does this without any account. Create one per address (Management › Directory › Mailing Lists in the WebUI), named toto1 on the toto.com domain, with [email protected] as its only recipient. Mail to [email protected] is then accepted and relayed straight to Gmail, with no mailbox, password or Sieve script involved. A list can have more than one recipient if you ever need to fan out.

Stalwart keeps the original envelope sender when it relays to an external address (no SRS), so Gmail may fail SPF for those copies, and messages from domains with a strict DMARC policy and no DKIM signature can end up in spam or be rejected. The mailing list page covers this: Mailing lists

Hi,

Thanks for your explanation!

I’ve tested both methods (Mailing List and Sieve redirect) on my Stalwart server, forwarding emails from an external Gmail account to another Gmail account.

Here are the results:

1. Mailing List

  • SPF: SOFTFAIL
  • DKIM: PASS (original Gmail signature)
  • DMARC: PASS

2. Sieve Redirect

  • SPF: PASS
  • DKIM: PASS (original Gmail signature + Stalwart RSA signature)
  • DMARC: PASS

Both messages were successfully delivered to Gmail.

But which method do you recommand ?

Thanks for your help!

For one address forwarded to Gmail I’d go with the Sieve redirect, and your test shows why. The redirected copy goes out with the account’s address as envelope sender and a DKIM signature for your domain, so SPF passes and Gmail can tie the mail to you. A mailing list keeps the original envelope sender, which your server isn’t authorised to send for, hence the SOFTFAIL.

Both of your tests passed DMARC because Gmail’s original DKIM signature survived the trip. That part doesn’t change with the method: if a sender relies on SPF alone and has a strict DMARC policy, the copy can fail DMARC either way.

The redirect costs you a full account per address, with its password, and you get one redirect per message by default (maxRedirects). A plain redirect without :copy stores nothing, so the mailbox stays empty. Bounces go to that account as well, while with a list they go back to the person who wrote. If you have a long list of addresses and the account overhead bothers you more than the odd SPF softfail, the mailing list is still a reasonable choice.