Updated: 28 September 2026 · Applies to: Postfix 3.8 (Ubuntu 24.04) and 3.10 (Ubuntu 26.04)

By default Postfix connects to other mail servers from the server's main IP address and introduces itself with the server's host name. On a dedicated server with several addresses you usually want more control: a chosen address for the mail, and a HELO name that matches that address. This guide sets up one extra sending address in Postfix, and the next guide shows how to give several domains their own addresses.

Why the address and the name must match

When Postfix connects it says "HELO name". Receivers compare that name with the reverse DNS of the address they see, and with the forward DNS of the name. If all three agree (address, PTR name, HELO name), the connection looks like it comes from a properly set up server. Gmail asks for valid forward and reverse DNS records, and Yahoo asks for meaningful, non-generic PTR records.

Before you start

  1. The extra address is configured and reaches the internet from that address (How to test that every additional IP address works on your server?, step 4, and How to check that outgoing port 25 works from your dedicated server?).
  2. The address has reverse DNS mail2.example.com and an A record from mail2.example.com to it (How to set reverse DNS (PTR) for many IP addresses and check forward-confirmed rDNS?).
  3. Postfix works (How to install and configure Postfix for sending on Ubuntu?).

1. Create a separate delivery service for this address

Postfix delivers mail through "transports", defined in /etc/postfix/master.cf. Add a new one at the end of the file. It is a copy of the normal smtp client with two options:

out2   unix  -       -       y       -       -       smtp
  -o smtp_bind_address=203.0.113.12
  -o smtp_helo_name=mail2.example.com
  -o smtp_bind_address_enforce=yes
  • out2 is the name of the transport. Use simple names (letters and digits).
  • smtp_bind_address makes this service connect from that IPv4 address.
  • smtp_helo_name is the HELO/EHLO name it sends.
  • smtp_bind_address_enforce=yes (Postfix 3.7 and later) defers the mail if the address cannot be used, instead of silently sending from another address.

If your server also has IPv6, mail may be sent over IPv6 with another source address. Either set smtp_bind_address6 as well or disable IPv6 delivery for this transport with -o inet_protocols=ipv4.

2. Use it

To send all mail through this transport, set it as the default:

sudo postconf -e "default_transport = out2"
sudo systemctl reload postfix

To use it only for some domains or customers, see How to give each domain or customer its own sending IP address in Postfix?.

3. Test

echo "bind test" | mail -s "Bind test" -a "From: test@example.com" yourname@gmail.com
sudo journalctl -t postfix/out2 --since "5 minutes ago"

Open the message at the receiver and check the "Received" header of the first hop: it must show mail2.example.com and the address 203.0.113.12. In Gmail use "Show original" and read the line Received: from mail2.example.com (mail2.example.com [203.0.113.12]).

Common problems

  • Mail is deferred with "Cannot assign requested address": the address is not configured on the server.
  • The receiver shows the main address: the message did not use the new transport; check default_transport or the sender-dependent map.
  • Connection times out from the extra address: the address is not routed for outgoing traffic (How to test that every additional IP address works on your server?).
  • Receivers complain about the HELO name: the name has no A record, or the PTR record names something else.

Frequently asked questions

Can I use several addresses for one domain?
Technically yes, but a stable reputation builds up faster when one kind of mail always leaves from the same address. See How to give each domain or customer its own sending IP address in Postfix?.

Do I need a separate Postfix instance for each address?
No. One instance with several transports is enough.

Source: Postfix configuration parameters (smtp_bind_address, smtp_helo_name).

Need a dedicated server, more IP addresses, or a hand with the setup?

Prefer a hand with the setup? Our engineers can do it for you: Hire an Expert, or use our on-demand server management.

Was this answer helpful? 0 Users Found This Useful (0 Votes)