O'Reilly logo

Postfix: The Definitive Guide by Kyle D. Dent

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Transport Maps

Postfix can be configured to relay to any other host, regardless of how DNS MX records are set up. This section discusses the transport_maps parameter in general. Later sections and other chapters in the book present specific configurations that use it.

Conceptually, transport maps override default transport types for delivery of messages. The transport_maps parameter points to one or more transport lookup tables. The following entry sets up /etc/postfix/transport as a transport map lookup table:

transport_maps = hash:/etc/postfix/transport

The keys in a transport lookup table are either complete email addresses or domains and subdomains. (Email addresses as lookup keys for transport maps require Postfix 2.0 or later.) When a destination address or domain matches a lefthand key it uses the righthand value to determine the delivery method and destination. Example 9-1 lists some possible transport map entries.

Example 9-1. Transport map entries

example.com        smtp:[192.168.23.56]:20025
oreilly.com        relay:[gateway.oreilly.com]
oreillynet.com     smtp
ora.com            maildrop
kdent@ora.com      error:no mail accepted for kdent

The format of righthand values can differ depending on the transport type, but generally has the form transport:nexthop, where nexthop often indicates a host and port for delivery. Each of the possible portions of the righthand value are described here:

transport

Refers to an entry from master.cf. If you are adding a new transport type, first create an entry for it in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required