the chroot jail and before dropping privileges. This is needed
on MacOS and would not hurt otherwise. Files: util/msg_logger.[hc],
global/maillog_client.c.
+
+20200108
+
+ UI cleanup: SMTP (and LMTP) client support for a list of
+ nexthop destinations separated by comma or whitespace. These
+ will be tried in the specified order. The list form can be
+ specified in relayhost, transport_maps, default_transport,
+ and sender_dependent_default_transport_maps. Examples:
+ "relayhost = foo.example, bar.example", and "default_transport
+ = smtp:foo.exmple, bar.example". Files: smtp/smtp.c,
+ smtp/smtp_connect.c, trivial-rewrite/resolve.c, proto/transport,
+ proto/postconf.proto, global/mail_params.c.
# transport (the first name of a mail delivery service entry
# in the Postfix master.cf file).
#
-# The interpretation of the nexthop field is transport
-# dependent. In the case of SMTP, specify a service on a
-# non-default port as host:service, and disable MX (mail
-# exchanger) DNS lookups with [host] or [host]:port. The []
-# form is required when you specify an IP address instead of
-# a hostname.
-#
-# A null transport and null nexthop result means "do not
+# The nexthop field usually specifies one recipient domain
+# or hostname. In the case of the Postfix SMTP/LMTP client,
+# the nexthop field may contain a list of nexthop destina-
+# tions separated by comma or whitespace (Postfix 3.5 and
+# later).
+#
+# The syntax of a nexthop destination is transport depen-
+# dent. With SMTP, specify a service on a non-default port
+# as host:service, and disable MX (mail exchanger) DNS
+# lookups with [host] or [host]:port. The [] form is
+# required when you specify an IP address instead of a host-
+# name.
+#
+# A null transport and null nexthop field means "do not
# change": use the delivery transport and nexthop informa-
# tion that would be used when the entire transport table
# did not exist.
# prevents mail routing loops when your machine is primary
# MX host for example.com.
#
-# In the case of delivery via SMTP, one may specify host-
-# name:service instead of just a host:
+# In the case of delivery via SMTP or LMTP, one may specify
+# host:service instead of just a host:
#
# example.com smtp:bar.example:2025
#
# be used. Specify [] around the hostname if MX lookups must
# be disabled.
#
+# Deliveries via SMTP or LMTP support multiple destinations
+# (Postfix >= 3.5):
+#
+# example.com smtp:bar.example, foo.example
+#
+# This tries to deliver to bar.example before trying to
+# deliver to foo.example.
+#
# The error mailer can be used to bounce mail:
#
# .example.com error:mail for *.example.com is not deliverable
# The text below provides only a parameter summary. See
# postconf(5) for more details including examples.
#
-# empty_address_recipient
-# The address that is looked up instead of the null
-# sender address.
+# empty_address_recipient (MAILER-DAEMON)
+# The recipient of mail addressed to the null
+# address.
#
-# parent_domain_matches_subdomains
-# List of Postfix features that use domain.tld pat-
-# terns to match sub.domain.tld (as opposed to
-# requiring .domain.tld patterns).
+# parent_domain_matches_subdomains (see 'postconf -d' out-
+# put)
+# A list of Postfix features where the pattern "exam-
+# ple.com" also matches subdomains of example.com,
+# instead of requiring an explicit ".example.com"
+# pattern.
#
-# transport_maps
-# List of transport lookup tables.
+# transport_maps (empty)
+# Optional lookup tables with mappings from recipient
+# address to (message delivery transport, next-hop
+# destination).
#
# SEE ALSO
# trivial-rewrite(8), rewrite and resolve addresses
# postmap(1), Postfix lookup table manager
#
# README FILES
-# Use "postconf readme_directory" or "postconf html_direc-
+# Use "postconf readme_directory" or "postconf html_direc-
# tory" to locate this information.
# ADDRESS_REWRITING_README, address rewriting guide
# DATABASE_README, Postfix lookup table overview
# FILTER_README, external content filter
#
# LICENSE
-# The Secure Mailer license must be distributed with this
+# The Secure Mailer license must be distributed with this
# software.
#
# AUTHOR(S)
can be enabled permanently for specific destinations.
<b>SMTP DESTINATION SYNTAX</b>
- SMTP destinations have the following form:
+ The Postfix SMTP+LMTP client supports multiple destinations separated
+ by comma or whitespace (Postfix 3.5 and later). SMTP destinations have
+ the following form:
<i>domainname</i>
ted as [<b>ipv6</b>:<i>address</i>].
<b>LMTP DESTINATION SYNTAX</b>
- LMTP destinations have the following form:
+ The Postfix SMTP+LMTP client supports multiple destinations separated
+ by comma or whitespace (Postfix 3.5 and later). LMTP destinations have
+ the following form:
<b>unix</b>:<i>pathname</i>
Connect to the local UNIX-domain server that is bound to the
Specify a string of the form <i>transport:nexthop</i>, where <i>transport</i>
is the name of a mail delivery transport defined in <a href="master.5.html">master.cf</a>.
The <i>:nexthop</i> destination is optional; its syntax is documented
-in the manual page of the corresponding delivery agent.
+in the manual page of the corresponding delivery agent. In the case of
+SMTP or LMTP, specify one or more destinations separated by comma or
+whitespace (with Postfix 3.5 and later).
</p>
<p>
(default: empty)</b></DT><DD>
<p>
-The next-hop destination of non-local mail; overrides non-local
+The next-hop destination(s) for non-local mail; overrides non-local
domains in recipient addresses. This information is overruled with
<a href="postconf.5.html#relay_transport">relay_transport</a>, <a href="postconf.5.html#sender_dependent_default_transport_maps">sender_dependent_default_transport_maps</a>,
<a href="postconf.5.html#default_transport">default_transport</a>, <a href="postconf.5.html#sender_dependent_relayhost_maps">sender_dependent_relayhost_maps</a>
</p>
<p>
-In the case of SMTP, specify a domain name, hostname, hostname:port,
-[hostname]:port, [hostaddress] or [hostaddress]:port. The form
-[hostname] turns off MX lookups.
+In the case of SMTP or LMTP delivery, specify one or more destinations
+in the form of a domain name, hostname, hostname:port, [hostname]:port,
+[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
+The form [hostname] turns off MX lookups. Multiple destinations are
+supported in Postfix 3.5 and later.
</p>
<p>
<pre>
<a href="postconf.5.html#relayhost">relayhost</a> = $<a href="postconf.5.html#mydomain">mydomain</a>
<a href="postconf.5.html#relayhost">relayhost</a> = [gateway.example.com]
-<a href="postconf.5.html#relayhost">relayhost</a> = uucphost
+<a href="postconf.5.html#relayhost">relayhost</a> = mail1.example:587, mail2.example:587
<a href="postconf.5.html#relayhost">relayhost</a> = [an.ip.add.ress]
</pre>
can be enabled permanently for specific destinations.
<b>SMTP DESTINATION SYNTAX</b>
- SMTP destinations have the following form:
+ The Postfix SMTP+LMTP client supports multiple destinations separated
+ by comma or whitespace (Postfix 3.5 and later). SMTP destinations have
+ the following form:
<i>domainname</i>
ted as [<b>ipv6</b>:<i>address</i>].
<b>LMTP DESTINATION SYNTAX</b>
- LMTP destinations have the following form:
+ The Postfix SMTP+LMTP client supports multiple destinations separated
+ by comma or whitespace (Postfix 3.5 and later). LMTP destinations have
+ the following form:
<b>unix</b>:<i>pathname</i>
Connect to the local UNIX-domain server that is bound to the
(the first name of a mail delivery service entry in the Postfix <a href="master.5.html"><b>mas-</b>
<b>ter.cf</b></a> file).
- The interpretation of the nexthop field is transport dependent. In the
- case of SMTP, specify a service on a non-default port as <i>host</i>:<i>service</i>,
- and disable MX (mail exchanger) DNS lookups with [<i>host</i>] or [<i>host</i>]:<i>port</i>.
- The [] form is required when you specify an IP address instead of a
- hostname.
+ The nexthop field usually specifies one recipient domain or hostname.
+ In the case of the Postfix SMTP/LMTP client, the nexthop field may con-
+ tain a list of nexthop destinations separated by comma or whitespace
+ (Postfix 3.5 and later).
- A null <i>transport</i> and null <i>nexthop</i> result means "do not change": use the
+ The syntax of a nexthop destination is transport dependent. With SMTP,
+ specify a service on a non-default port as <i>host</i>:<i>service</i>, and disable MX
+ (mail exchanger) DNS lookups with [<i>host</i>] or [<i>host</i>]:<i>port</i>. The [] form is
+ required when you specify an IP address instead of a hostname.
+
+ A null <i>transport</i> and null <i>nexthop</i> field means "do not change": use the
delivery transport and nexthop information that would be used when the
entire transport table did not exist.
In the above example, the [] suppress MX lookups. This prevents mail
routing loops when your machine is primary MX host for <b>example.com</b>.
- In the case of delivery via SMTP, one may specify <i>hostname</i>:<i>service</i>
+ In the case of delivery via SMTP or LMTP, one may specify <i>host</i>:<i>service</i>
instead of just a host:
<b>example.com <a href="smtp.8.html">smtp</a>:bar.example:2025</b>
Instead of a numerical port a symbolic name may be used. Specify []
around the hostname if MX lookups must be disabled.
+ Deliveries via SMTP or LMTP support multiple destinations (Postfix >=
+ 3.5):
+
+ <b>example.com <a href="smtp.8.html">smtp</a>:bar.example, foo.example</b>
+
+ This tries to deliver to <b>bar.example</b> before trying to deliver to
+ <b>foo.example</b>.
+
The error mailer can be used to bounce mail:
<b>.example.com <a href="error.8.html">error</a>:mail for *.example.com is not deliverable</b>
below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more
details including examples.
- <b><a href="postconf.5.html#empty_address_recipient">empty_address_recipient</a></b>
- The address that is looked up instead of the null sender
- address.
+ <b><a href="postconf.5.html#empty_address_recipient">empty_address_recipient</a> (MAILER-DAEMON)</b>
+ The recipient of mail addressed to the null address.
- <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a></b>
- List of Postfix features that use <i>domain.tld</i> patterns to match
- <i>sub.domain.tld</i> (as opposed to requiring <i>.domain.tld</i> patterns).
+ <b><a href="postconf.5.html#parent_domain_matches_subdomains">parent_domain_matches_subdomains</a> (see 'postconf -d' output)</b>
+ A list of Postfix features where the pattern "example.com" also
+ matches subdomains of example.com, instead of requiring an
+ explicit ".example.com" pattern.
- <b><a href="postconf.5.html#transport_maps">transport_maps</a></b>
- List of transport lookup tables.
+ <b><a href="postconf.5.html#transport_maps">transport_maps</a> (empty)</b>
+ Optional lookup tables with mappings from recipient address to
+ (message delivery transport, next-hop destination).
<b>SEE ALSO</b>
<a href="trivial-rewrite.8.html">trivial-rewrite(8)</a>, rewrite and resolve addresses
Specify a string of the form \fItransport:nexthop\fR, where \fItransport\fR
is the name of a mail delivery transport defined in master.cf.
The \fI:nexthop\fR destination is optional; its syntax is documented
-in the manual page of the corresponding delivery agent.
+in the manual page of the corresponding delivery agent. In the case of
+SMTP or LMTP, specify one or more destinations separated by comma or
+whitespace (with Postfix 3.5 and later).
.PP
Example:
.PP
.PP
This feature is available in Postfix 2.0 and later.
.SH relayhost (default: empty)
-The next\-hop destination of non\-local mail; overrides non\-local
+The next\-hop destination(s) for non\-local mail; overrides non\-local
domains in recipient addresses. This information is overruled with
relay_transport, sender_dependent_default_transport_maps,
default_transport, sender_dependent_relayhost_maps
internal DNS uses no MX records, specify the name of the intranet
gateway host instead.
.PP
-In the case of SMTP, specify a domain name, hostname, hostname:port,
-[hostname]:port, [hostaddress] or [hostaddress]:port. The form
-[hostname] turns off MX lookups.
+In the case of SMTP or LMTP delivery, specify one or more destinations
+in the form of a domain name, hostname, hostname:port, [hostname]:port,
+[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
+The form [hostname] turns off MX lookups. Multiple destinations are
+supported in Postfix 3.5 and later.
.PP
If you're connected via UUCP, see the UUCP_README file for useful
information.
.ft C
relayhost = $mydomain
relayhost = [gateway.example.com]
-relayhost = uucphost
+relayhost = mail1.example:587, mail2.example:587
relayhost = [an.ip.add.ress]
.fi
.ad
(the first name of a mail delivery service entry in the Postfix
\fBmaster.cf\fR file).
-The interpretation of the nexthop field is transport
-dependent. In the case of SMTP, specify a service on a non\-default
+The nexthop field usually specifies one recipient domain
+or hostname. In the case of the Postfix SMTP/LMTP client,
+the nexthop field may contain a list of nexthop destinations
+separated by comma or whitespace (Postfix 3.5 and later).
+
+The syntax of a nexthop destination is transport dependent.
+With SMTP, specify a service on a non\-default
port as \fIhost\fR:\fIservice\fR, and disable MX (mail exchanger)
DNS lookups with [\fIhost\fR] or [\fIhost\fR]:\fIport\fR. The [] form
is required when you specify an IP address instead of a hostname.
-A null \fItransport\fR and null \fInexthop\fR result means "do
+A null \fItransport\fR and null \fInexthop\fR field means "do
not change": use the delivery transport and nexthop information
that would be used when the entire transport table did not exist.
This prevents mail routing loops when your machine is primary MX
host for \fBexample.com\fR.
-In the case of delivery via SMTP, one may specify
-\fIhostname\fR:\fIservice\fR instead of just a host:
+In the case of delivery via SMTP or LMTP, one may specify
+\fIhost\fR:\fIservice\fR instead of just a host:
.nf
\fBexample.com smtp:bar.example:2025\fR
port \fB2025\fR. Instead of a numerical port a symbolic name may be
used. Specify [] around the hostname if MX lookups must be disabled.
+Deliveries via SMTP or LMTP support multiple destinations
+(Postfix >= 3.5):
+
+.nf
+ \fBexample.com smtp:bar.example, foo.example\fR
+.fi
+
+This tries to deliver to \fBbar.example\fR before trying
+to deliver to \fBfoo.example\fR.
+
The error mailer can be used to bounce mail:
.nf
The following \fBmain.cf\fR parameters are especially relevant.
The text below provides only a parameter summary. See
\fBpostconf\fR(5) for more details including examples.
-.IP \fBempty_address_recipient\fR
-The address that is looked up instead of the null sender address.
-.IP \fBparent_domain_matches_subdomains\fR
-List of Postfix features that use \fIdomain.tld\fR patterns
-to match \fIsub.domain.tld\fR (as opposed to
-requiring \fI.domain.tld\fR patterns).
-.IP \fBtransport_maps\fR
-List of transport lookup tables.
+.IP "\fBempty_address_recipient (MAILER\-DAEMON)\fR"
+The recipient of mail addressed to the null address.
+.IP "\fBparent_domain_matches_subdomains (see 'postconf -d' output)\fR"
+A list of Postfix features where the pattern "example.com" also
+matches subdomains of example.com,
+instead of requiring an explicit ".example.com" pattern.
+.IP "\fBtransport_maps (empty)\fR"
+Optional lookup tables with mappings from recipient address to
+(message delivery transport, next\-hop destination).
.SH "SEE ALSO"
.na
.nf
.nf
.ad
.fi
+The Postfix SMTP+LMTP client supports multiple destinations
+separated by comma or whitespace (Postfix 3.5 and later).
SMTP destinations have the following form:
.IP \fIdomainname\fR
.IP \fIdomainname\fR:\fIport\fR
.nf
.ad
.fi
+The Postfix SMTP+LMTP client supports multiple destinations
+separated by comma or whitespace (Postfix 3.5 and later).
LMTP destinations have the following form:
.IP \fBunix\fR:\fIpathname\fR
Connect to the local UNIX\-domain server that is bound to the specified
Specify a string of the form <i>transport:nexthop</i>, where <i>transport</i>
is the name of a mail delivery transport defined in master.cf.
The <i>:nexthop</i> destination is optional; its syntax is documented
-in the manual page of the corresponding delivery agent.
+in the manual page of the corresponding delivery agent. In the case of
+SMTP or LMTP, specify one or more destinations separated by comma or
+whitespace (with Postfix 3.5 and later).
</p>
<p>
%PARAM relayhost
<p>
-The next-hop destination of non-local mail; overrides non-local
+The next-hop destination(s) for non-local mail; overrides non-local
domains in recipient addresses. This information is overruled with
relay_transport, sender_dependent_default_transport_maps,
default_transport, sender_dependent_relayhost_maps
</p>
<p>
-In the case of SMTP, specify a domain name, hostname, hostname:port,
-[hostname]:port, [hostaddress] or [hostaddress]:port. The form
-[hostname] turns off MX lookups.
+In the case of SMTP or LMTP delivery, specify one or more destinations
+in the form of a domain name, hostname, hostname:port, [hostname]:port,
+[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
+The form [hostname] turns off MX lookups. Multiple destinations are
+supported in Postfix 3.5 and later.
</p>
<p>
<pre>
relayhost = $mydomain
relayhost = [gateway.example.com]
-relayhost = uucphost
+relayhost = mail1.example:587, mail2.example:587
relayhost = [an.ip.add.ress]
</pre>
# (the first name of a mail delivery service entry in the Postfix
# \fBmaster.cf\fR file).
#
-# The interpretation of the nexthop field is transport
-# dependent. In the case of SMTP, specify a service on a non-default
+# The nexthop field usually specifies one recipient domain
+# or hostname. In the case of the Postfix SMTP/LMTP client,
+# the nexthop field may contain a list of nexthop destinations
+# separated by comma or whitespace (Postfix 3.5 and later).
+#
+# The syntax of a nexthop destination is transport dependent.
+# With SMTP, specify a service on a non-default
# port as \fIhost\fR:\fIservice\fR, and disable MX (mail exchanger)
# DNS lookups with [\fIhost\fR] or [\fIhost\fR]:\fIport\fR. The [] form
# is required when you specify an IP address instead of a hostname.
#
-# A null \fItransport\fR and null \fInexthop\fR result means "do
+# A null \fItransport\fR and null \fInexthop\fR field means "do
# not change": use the delivery transport and nexthop information
# that would be used when the entire transport table did not exist.
#
# This prevents mail routing loops when your machine is primary MX
# host for \fBexample.com\fR.
#
-# In the case of delivery via SMTP, one may specify
-# \fIhostname\fR:\fIservice\fR instead of just a host:
+# In the case of delivery via SMTP or LMTP, one may specify
+# \fIhost\fR:\fIservice\fR instead of just a host:
#
# .nf
# \fBexample.com smtp:bar.example:2025\fR
# port \fB2025\fR. Instead of a numerical port a symbolic name may be
# used. Specify [] around the hostname if MX lookups must be disabled.
#
+# Deliveries via SMTP or LMTP support multiple destinations
+# (Postfix >= 3.5):
+#
+# .nf
+# \fBexample.com smtp:bar.example, foo.example\fR
+# .fi
+#
+# This tries to deliver to \fBbar.example\fR before trying
+# to deliver to \fBfoo.example\fR.
+#
# The error mailer can be used to bounce mail:
#
# .nf
# The following \fBmain.cf\fR parameters are especially relevant.
# The text below provides only a parameter summary. See
# \fBpostconf\fR(5) for more details including examples.
-# .IP \fBempty_address_recipient\fR
-# The address that is looked up instead of the null sender address.
-# .IP \fBparent_domain_matches_subdomains\fR
-# List of Postfix features that use \fIdomain.tld\fR patterns
-# to match \fIsub.domain.tld\fR (as opposed to
-# requiring \fI.domain.tld\fR patterns).
-# .IP \fBtransport_maps\fR
-# List of transport lookup tables.
+# .IP "\fBempty_address_recipient (MAILER-DAEMON)\fR"
+# The recipient of mail addressed to the null address.
+# .IP "\fBparent_domain_matches_subdomains (see 'postconf -d' output)\fR"
+# A list of Postfix features where the pattern "example.com" also
+# matches subdomains of example.com,
+# instead of requiring an explicit ".example.com" pattern.
+# .IP "\fBtransport_maps (empty)\fR"
+# Optional lookup tables with mappings from recipient address to
+# (message delivery transport, next-hop destination).
# SEE ALSO
# trivial-rewrite(8), rewrite and resolve addresses
# master(5), master.cf file format
msg_fatal("%s parameter setting must not contain multiple values: %s",
VAR_MYORIGIN, var_myorigin);
- if (var_relayhost[strcspn(var_relayhost, CHARS_COMMA_SP)])
- msg_fatal("%s parameter setting must not contain multiple values: %s",
- VAR_RELAYHOST, var_relayhost);
-
/*
* One more sanity check.
*/
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20200105"
+#define MAIL_RELEASE_DATE "20200111"
#define MAIL_VERSION_NUMBER "3.5"
#ifdef SNAPSHOT
/* SMTP DESTINATION SYNTAX
/* .ad
/* .fi
+/* The Postfix SMTP+LMTP client supports multiple destinations
+/* separated by comma or whitespace (Postfix 3.5 and later).
/* SMTP destinations have the following form:
/* .IP \fIdomainname\fR
/* .IP \fIdomainname\fR:\fIport\fR
/* LMTP DESTINATION SYNTAX
/* .ad
/* .fi
+/* The Postfix SMTP+LMTP client supports multiple destinations
+/* separated by comma or whitespace (Postfix 3.5 and later).
/* LMTP destinations have the following form:
/* .IP \fBunix\fR:\fIpathname\fR
/* Connect to the local UNIX-domain server that is bound to the specified
}
/*
- * Future proofing: do a null destination sanity check in case we allow
- * the primary destination to be a list (it could be just separators).
+ * Do a null destination sanity check in case the primary destination is
+ * a list that consists of only separators.
*/
- sites = argv_alloc(1);
- argv_add(sites, nexthop, (char *) 0);
+ sites = argv_split(nexthop, CHARS_COMMA_SP);
if (sites->argc == 0)
msg_panic("null destination: \"%s\"", nexthop);
non_fallback_sites = sites->argc;