# Email masking functions

You can mask email addresses.

| Function | Random masking | Consistent masking | Format-preserving encryption | Input data validation |
| --- | --- | --- | --- | --- |
| Mask email full domain by character | Yes | Yes | No | Yes |
| Mask email left part of domain by character | Yes | Yes | No | Yes |
| Mask email local part by character | Yes | Yes | No | Yes |

## Mask email local part

This function masks all characters before the @ character. Two methods are available: By character and From a list of values.

This function only applies on Strings.

This function requires an extra parameter.

| Option | Description |
| --- | --- |
| Method | When using the By<br>character method, this function masks what comes before the @<br>character with a character.<br><br>When using the From a list of values method, this function<br>masks what comes before the @ character with one of the values from the<br>specified list. |
| Extra parameter | This function requires an extra parameter.<br><br>When using the By<br>character method, the extra parameter must be a character.<br>If you specify an invalid extra parameter, like a string, a list, multiple<br>characters or a digit, all characters before the @ character will be masked<br>with X characters by default.<br><br>When<br>using the From a list of values, the<br>extra parameter can be a comma-separated list of values or a path to a file<br>containing a list of values. If you do not specify an extra parameter, all<br>characters before the @ character are removed. |

In the first example, all characters before the @ character are masked with the user-defined characters.

In the second example, all characters before the @ character are masked with one of the values from the user-defined list.

| Input value | Method | Extra parameter | Example of masked value |
| --- | --- | --- | --- |
| johnsmith@company.com | By<br>character | "p" | ppppppppp@company.com |
| johnsmith@company.com | From a list of<br>values | "z,x,c,h" | xxxxxxxxx@company.com |

## Mask email full domain

This function masks what comes after the @ character. Two methods are available: By character and From a list of values.

This function only applies on Strings.

| Option | Description |
| --- | --- |
| Method | When using the By<br>character method, this function masks what comes after the @<br>character with a character.<br><br>When using the From a list of values method, this function<br>masks what comes after the @ character with one of the values from the<br>specified list. |
| Extra parameter | This function requires an extra parameter.<br><br>When using the By<br>character method, the extra parameter must be a character.<br>If you specify an invalid extra parameter, like a string, a list, multiple<br>characters or a digit, all characters after the @ character will be masked<br>with X characters by default.<br><br>When<br>using the From a list of values, the<br>extra parameter can be a comma-separated list of domains or a path to a file<br>containing a list of domains. If you do not specify an extra parameter, all<br>characters after the @ character are removed. |

In the following example, all characters after the @ character are masked with one of the values from the user-defined list.

| Input value | Method | Extra parameter | Example of a masked value |
| --- | --- | --- | --- |
| johnsmith@company.com | From a list of<br>values | "newtalend.com,newcompany.org" | johnsmith@newtalend.com |

## Mask email left part of domain

This function masks what comes between the @ character and the dot in e-mail adresses. Two methods are available: By character and From a list of values.

This function only applies on Strings.

| Option | Description |
| --- | --- |
| Method | When using the By<br>character method, this function masks what comes between the @<br>character and the dot with a character.<br><br>When using the<br>From a list of values method,<br>this function masks what comes between the @ character and the dot with one<br>of the values from the specified list. |
| Extra parameter | This function requires an extra parameter.<br><br>When using the By<br>character method, the extra parameter must be a character.<br>If you specify an invalid extra parameter, like a string, a list, multiple<br>characters or a digit, all characters between the @ character and the dot<br>will be masked with X characters by<br>default.<br><br>When using the From a list of<br>values, the extra parameter can be a comma-separated list of<br>domains or a path to a file containing a list of domains. If you do not<br>specify an extra parameter, all characters between the @ character and the<br>dot are removed. |

In the following example, all characters between the @ character and the dot are masked with one of the values from the user-defined list.

| Input value | Method | Extra parameter | Example of a masked value |
| --- | --- | --- | --- |
| johnsmith@company.com | From a list of<br>values | "newtalend,talendforge" | johnsmith@newtalend.com |