Email masking policy (predefined)

The predefined Email policy masks a selected column by generating a new email address for each input value.

The Email policy generates a replacement email address for each input value. You can control whether the output is deterministic or randomized, preserve or modify the local part (before @) and domain (after @), apply a separator, set the output case, supply a custom domain list, or replace the local part with a prefixed identifier.

An email address consists of two parts separated by @: the local part (the name segment before @) and the domain (the segment after @). The policy generates a replacement local part and domain independently, subject to the configured options.

Note: Custom domain values do not include the leading @ (for example, ibm.com). The @ is added automatically between the local part and the custom domain in the output.

Configuration options

Use the following options to configure the Email policy.

Masking Method (required)

Controls whether the same input always produces the same output.

  • Repeatable — the same input value always produces the same output.
  • Random — each transformation produces a different output, even for identical inputs.
Email case (required)

Controls the case of the entire output email address.

Table 1. Email Case options
Option Behavior
Normal Output uses generated or preserved casing.
Upper Entire output is uppercase.
Lower Entire output is lowercase.
Preserve Email Name (optional)
Preserves the original local part verbatim in the output, including its original separators and casing. The domain is still generated or replaced according to other settings. Incompatible with User Prefix and Use First Character Only.
Use First Character Only (optional)

Reduces the local part to its first character followed by the remainder after the first separator. Works with all separator types (., -, _). For example:

  • john.doej.doe
  • TRYING-othernameT-othername
  • test_RANDOMnamet_RANDOMname

Incompatible with User Prefix and Preserve Email Name.

Preserve Domain Name (optional)
Preserves the original domain of each input row verbatim in the output. The local part is still generated or modified according to other settings.
Email Separator (optional)
Character or characters to use as the separator in the output local part. Replaces any existing separators in the generated or preserved local part. Incompatible with User Prefix.
Custom Domains (optional)
A comma-separated list of domain values to use in place of a generated domain (for example, ibm.com,example.com). Domains are assigned randomly across rows.
User Prefix (optional)
A literal string prepended to randomly generated digits to form the entire local part (for example, employeeemployee1423). Replaces any generated or preserved local part. Incompatible with Preserve Email Name, Use First Character Only, and Email Separator.

The following options are mutually incompatible:

Table 2. Email policy option incompatibilities
Option Incompatible with
User Prefix Preserve Email Name, Use First Character Only, Email Separator
Use First Character Only User Prefix, Preserve Email Name

API configuration (policy_metadata)

Use the following keys to configure the Email policy through the API.

Table 3. Email policy_metadata fields
Key UI field Type Description
algo Masking Method String
  • "repeatable" (default)
  • "random"
case Email Case String
  • "normal"
  • "upper"
  • "lower"
  • Or use "" for default (normal)
customDomains Custom Domains String Comma-separated list of domains (for example, "ibm.com,example.com"). Use "" for none.
firstChar First Character Only Boolean string
  • "true" to use first character only
  • "false" to keep all characters
keepDomain Preserve Domain Name Boolean string
  • "true" to preserve the original domain
  • "false" or "" to generate
keepName Preserve Email Name Boolean string
  • "true" to preserve the original local part
  • "false" or "" to generate
separator Email Separator String Separator character or characters to use in the output local part. Use "" for none.
userPrefix User Prefix String Literal prefix string. Use "" for none.
{
  "algo": "repeatable",
  "case": "normal",
  "customDomains": "ibm.com",
  "firstChar": "true",
  "keepDomain": "false",
  "keepName": "false",
  "separator": "",
  "userPrefix": ""
}

Known limitations

The Email policy has the following limitations.

Use First Character Only reduces to the first character regardless of separator type
The reduction applies to all separator types. The first segment of the local part is reduced to its first character; everything after the first separator is preserved. For example, TRYING-othernameT-othername.
If you do not have custom domains and set keepDomain to false, the domain output can be unexpected
To avoid this issue, set keepDomain to true unless you have custom domains configured.
User Prefix numeric suffixes are not guaranteed to be unique across rows
The numeric suffix appended to a User Prefix is randomly generated and may coincidentally repeat across rows or runs under the Random algorithm.
Incompatible option combinations produce unexpected output without a warning
Configuring incompatible options (for example, User Prefix with Preserve Email Name) may produce unexpected results. Refer to the option compatibility table before combining options.