---
title: "Configuring SMTP on a Load Balancer service"
description: "- An OVHcloud Load Balancer service in your OVHcloud account"
url: https://docs.us.ovhcloud.com/en/network/load-balancer/configuring-smtp-service
lang: en
---
> For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt.

# Configuring SMTP on a Load Balancer service

## Requirements

- An [OVHcloud Load Balancer](https://us.ovhcloud.com/network/load-balancer/) service in your OVHcloud account

- Access to the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/)

- A Postfix-type SMTP service installed and configured on your servers

  **Warning:**

  **NOTE:** This guide assumes a working knowledge of SMTP protocol and service operation.

 

## Instructions

As a reminder, each protocol (HTTP and TCP) in the OVHcloud Load Balancer service has its own associated front-ends, server clusters, and servers.

**Warning:**

**NOTE:** The order in which elements are created is important. In particular, the server clusters must be configured before we can attach servers to them.

### Access your OVHcloud Load Balancer service

#### Via OVHcloud Control Panel

From the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), navigate to the `Load Balancer` section via the `Network` menu.

**Note:** If you are not using the beta version of the OVHcloud Control Panel, you will find the `Load Balancer` section via the `Bare Metal Cloud` or `Hosted Private Cloud` menus.

In the **Home** tab, you will see the following:

#### Via API

Via the [OVHcloud API](https://api.us.ovhcloud.com/), use the following call:

[GET /ipLoadbalancing](https://api.us.ovhcloud.com/console/?section=/ipLoadbalancing&branch=v1#get-/ipLoadbalancing)

For more information on the API’s features, you can refer to [the following guide](https://docs.us.ovhcloud.com/en/network/load-balancer/ovhcloud-api-quick-reference.md).

 

### Add a server cluster

We will add a server cluster of TCP servers to our service, which is the part that balances traffic on the servers.

#### Via OVHcloud Control Panel

From the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/) select the `Server clusters` tab and click the `Add a server cluster` button.

On the next screen, fill in the fields:
- **Name** (optional)
- **Protocol:** `SSL TCP (TLS)`
- **Port:** 25
- **Datacenter**

**Note:** If no ports are specified, your OVHcloud Load Balancer will automatically use the same port as the corresponding front-end. Also, in the **Advanced settings**, you can add an SMTP probe on your server cluster.

Click `Add` once you have filled in the fields.

Your server cluster should appear in the list in the `Server clusters` tab.

#### Via API

From the [OVHcloud API](https://api.us.ovhcloud.com/) you can:
- List TCP server clusters:

  `GET /ipLoadbalancing/{serviceName}/tcp/farm`

- Find details of a specific TCP server:

  `GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}`

- Add a new TCP server cluster:

  `POST /ipLoadbalancing/{serviceName}/tcp/farm`

- Modify a specific server cluster:

  `PUT /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}`

- Delete a specific server cluster:

  `DELETE /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}`

 

### Add a server

We will now add a server to our server.

#### Via OVHcloud Control Panel

In the `Server clusters` tab, select the cluster you want to add a server to by clicking the corresponding line. The list of servers already configured in the cluster will appear beneath the list of clusters, along with the `Add a server` button. Click this button to add a new server.
The mandatory fields are _IPv4 address_, _Status_, and _ProxyProtocol version_. If a server port is configured, it will override the port defined in the farm. To keep the configuration as standard as possible and easy to maintain, we recommend only using this parameter in advanced cases.

**Warning:** **NOTE:** It is important to configure ProxyProtocol in version v1, so that you can retrieve the real source IP on your SMTP service. Postfix is compatible with this protocol.

Click `Add` once you have filled in the fields.

Your server should appear in the `Server clusters` tab, just below the server cluster created in the previous step.

#### Via API

From the [OVHcloud API](https://api.us.ovhcloud.com/) you can:
- List servers in the server cluster:

  `GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server`

- Find details of a specific server:

  `GET /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}`

- Add a new server:

  `POST /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server`

- Modify a specific server:

  `PUT /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server/{serverId}`

- Delete a specific server:

  `DELETE /ipLoadbalancing/{serviceName}/tcp/farm/{farmId}/server`

 

### Add a frontend

We will now add a frontend to our service and connect it to our server cluster. The front-end is the component of your OVHcloud Load Balancer that exposes your service on the internet.

#### Via OVHcloud Control Panel

In the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), from the `Front-ends` tab, click `Add a front-end`.

On the next screen, fill in the fields:
- **Name** (optional)

- **Protocol:** `SSL TCP (TLS)`

- **Port:** 25

  **Note:**

  If you want your service to be available across several ports at once, you can specify a list of ports, separated by commas, or a range of ports, in the format "-".

- **Datacenter**
- **Default server cluster:** the cluster you created at the beginning of this guide.

**Warning:** **NOTE:** If you configured a probe on your cluster, you need to open the **Advanced settings** to configure a probe here as well.

If you have routed Additional IPs to your OVHcloud Load Balancer service, you can also attach a front-end to one or more specific Additional IPs.
Click `Add` once you have filled in the fields.

Your front-end will appear in the `Front-ends` tab.

#### Via API

From the [OVHcloud API](https://api.us.ovhcloud.com/) you can:
- List TCP front-ends:

  `GET /ipLoadbalancing/{serviceName}/tcp/frontend`

- Find details of a specific front-end:

  `GET /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}`

- Add a new front-end:

  `POST /ipLoadbalancing/{serviceName}/tcp/frontend`

- Modify a specific front-end:

  `PUT /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}`

- Delete a specific front-end:

  `DELETE /ipLoadbalancing/{serviceName}/tcp/frontend/{frontendId}`

 

### Apply the modifications

The modifications made to your OVHcloud Load Balancer must be _explicitly applied_ in each of the zones configured for your service. Only at this point will they be visible to your website visitors. This way, you can make complex configuration changes several times, and only apply them once the configuration is ready.

**Note:**

If you have several regions, you must apply the same configuration for each of them.

#### Via OVHcloud Control Panel

In the [OVHcloud Control Panel](https://manager.us.ovhcloud.com/), click `Apply configuration` in the yellow banner.
On the next screen, select `☑` your **Datacenter** and click `Apply configuration` again.

#### Via API

From the [OVHcloud API](https://api.us.ovhcloud.com/), you can apply your configuration with the following API call:

[POST /ipLoadbalancing/{serviceName}/refresh](https://api.us.ovhcloud.com/console/?section=/ipLoadbalancing&branch=v1#post-/ipLoadbalancing/-serviceName-/refresh)

 

### Postfix configuration

To make Postfix compatible with HAProxy _ProxyProtocol_, an option is required in the postfix main.cf configuration file:

```
smtp_upstream_proxy_protocol = haproxy
```

You then need to restart your Postfix daemon.

 

### Confirmation

After you have completed all of these steps, you should now have a functional Load Balancer service for your SMTP servers. You can now check the service status by requesting your IP Load Balancer as an SMTP server.

 

## Go further

Browse all the [Load Balancer guides](https://docs.us.ovhcloud.com/en/network/load-balancer/landing-page-load-balancer.md).

Browse the rest of the [OVHcloud US documentation](https://docs.us.ovhcloud.com/en/index.md) for guides on our other products and services.

Learn more about [Load Balancer](https://us.ovhcloud.com/network/load-balancer/) on the OVHcloud US website.
