Custom masked email addresses

Your question

I have way to many privacy addresses already created and I would like to import them to Stalwart so that I dont have to change all of them again.
We are talking around 200 aliases that are currently managed on addy.io.
Can I somehow import them in the format [email protected]?

This is a good confirmation: masks can be created with an explicit emailPrefix (and even emailDomain), which is exactly what’s needed to bring in existing [email protected] style addresses. Let me verify the exact behavior of emailPrefix combined with domain to make sure the full desired local part can be specified.

Yes, that’s possible using the emailPrefix field on masked email creation, which lets you force the local part of the generated address.

Masked email is an Enterprise feature. To bulk-import your existing addresses, you’d use stalwart-cli to create a MaskedEmail object per address and specify the exact local part with emailPrefix (and emailDomain if you need to pin the domain), e.g.:

stalwart-cli create masked-email --field emailPrefix=service.123xy --field emailDomain=alias.domain.eu --field description='imported from addy.io'

Note emailPrefix only sets the start of the local part (the server may still append characters after it), and it’s limited to lowercase letters, digits and underscore, so you’d need to script this 200 times via the CLI or the JMAP x:MaskedEmail/set create call, one alias per call. There’s no bulk CSV import feature documented, just per-address creation through CLI, WebUI, or JMAP. Also check maxMaskedAddresses quota on the account, since with 200 addresses you may need to raise or unset that limit.

Reference: Masked email | Stalwart and MaskedEmail | Stalwart

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

I have added my alias.domain.eu and domain.eu in Domains.

When trying to create example alias [email protected] I get error “The specified domain is not valid for this account.”.

I also tried to create a alias for user [email protected], but error still persists.

That error is coming from the Masked Addresses feature, not from plain aliases. A masked address has to be on the account’s own domain: the check requires every address already on the account to be on the same domain as the masked one, so asking for a masked address on alias.domain.eu while the account lives on another domain gets rejected, which is why adding alias.domain.eu as a domain didn’t help. Masked addresses are meant to be self-service privacy addresses on your own domain, not a way to model arbitrary external alias domains.

For 200 existing addresses like [email protected], use plain aliases on the target account instead. You’ve already added alias.domain.eu as a domain; make sure its MX points here, then attach each address as an alias of the account that should receive it. Rather than clicking through 200 of them, do it in bulk with stalwart-cli apply from an NDJSON plan (or a scripted Principal/set).