<!-- review: finished -->

<a id="mail-realip"></a>

# RealIP

The module is used to change the client address and port to the ones sent in the
PROXY protocol header. The PROXY protocol must be previously enabled by setting
the `proxy_protocol` parameter in the [listen](https://en.angie.software//angie/docs/configuration/modules/mail/index.md#m-listen) directive.

<a id="configuration-example-53"></a>

## Configuration Example

```nginx
listen 110 proxy_protocol;

set_real_ip_from  192.168.1.0/24;
set_real_ip_from  192.168.2.1;
set_real_ip_from  2001:0db8::/32;
```

<a id="directives-61"></a>

## Directives

<a id="index-0"></a>

<a id="m-set-real-ip-from"></a>

### set_real_ip_from

| [Syntax](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)   | `set_real_ip_from` address | CIDR | `unix:`;   |
|------------------------------------------------------------------------------------------|------------------------------------------------|
| Default                                                                                  | —                                              |
| [Context](https://en.angie.software//angie/docs/configuration/configfile.md#configfile)  | mail, server                                   |

Defines trusted addresses that are known to send correct replacement addresses.
If the special value `unix:` is specified, all UNIX domain sockets will
be trusted.
