mirror of
https://github.com/vdukhovni/postfix
synced 2025-08-28 20:57:56 +00:00
postfix-3.9-20240129
This commit is contained in:
parent
261ef16d2f
commit
36c1c0967b
@ -27772,3 +27772,18 @@ Apologies for any names omitted.
|
|||||||
postdrop/postdrop.c, postsuper/postsuper.c, sendmail/sendmail.c,
|
postdrop/postdrop.c, postsuper/postsuper.c, sendmail/sendmail.c,
|
||||||
dnsblog/dnsblog.c, postkick/postkick.c, postlock/postlock.c,
|
dnsblog/dnsblog.c, postkick/postkick.c, postlock/postlock.c,
|
||||||
qmgr/qmgr.c, qmqpd/qmqpd.c, trivial-rewrite/trivial-rewrite.c.
|
qmgr/qmgr.c, qmqpd/qmqpd.c, trivial-rewrite/trivial-rewrite.c.
|
||||||
|
|
||||||
|
20240129
|
||||||
|
|
||||||
|
Documentation: be more precise about server lookups with
|
||||||
|
MX or SRV records. File: smtp/smtp.c.
|
||||||
|
|
||||||
|
Documentation: postlogd is not a short-running process. It
|
||||||
|
wil keep running until it reaches the max_idle limit. File:
|
||||||
|
postlogd/postlogd.c.
|
||||||
|
|
||||||
|
Cleanup (no semantic change): in the mysql: and pgsql:
|
||||||
|
clients, made the hard-coded idle and retry timer settings
|
||||||
|
configurable, and updated the mysql_table(5) and pgsql_table(5)
|
||||||
|
manpages. Files: global/dict_mysql.c, global/dict_pgsql.c,
|
||||||
|
proto/mysql_table, proto/pgsql_table.
|
||||||
|
@ -29,13 +29,9 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
again at a later time. Delivery status reports are sent to the
|
again at a later time. Delivery status reports are sent to the
|
||||||
<a href="bounce.8.html"><b>bounce</b>(8)</a>, <a href="defer.8.html"><b>defer</b>(8)</a> or <a href="trace.8.html"><b>trace</b>(8)</a> daemon as appropriate.
|
<a href="bounce.8.html"><b>bounce</b>(8)</a>, <a href="defer.8.html"><b>defer</b>(8)</a> or <a href="trace.8.html"><b>trace</b>(8)</a> daemon as appropriate.
|
||||||
|
|
||||||
The SMTP+LMTP client looks up a list of mail exchanger addresses for
|
The server lookup strategy is different for SMTP and LMTP. The details
|
||||||
the destination host, sorts the list by preference, and connects to
|
are given below under in the sections "SMTP DESTINATION SYNTAX" and
|
||||||
each listed address until it finds a server that responds.
|
"LMTP DESTINATION SYNTAX".
|
||||||
|
|
||||||
When a server is not reachable, or when mail delivery fails due to a
|
|
||||||
recoverable error condition, the SMTP+LMTP client will try to deliver
|
|
||||||
the mail to an alternate host.
|
|
||||||
|
|
||||||
After a successful mail transaction, a connection may be saved to the
|
After a successful mail transaction, a connection may be saved to the
|
||||||
<a href="scache.8.html"><b>scache</b>(8)</a> connection cache server, so that it may be used by any
|
<a href="scache.8.html"><b>scache</b>(8)</a> connection cache server, so that it may be used by any
|
||||||
@ -46,51 +42,64 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
can be enabled permanently for specific destinations.
|
can be enabled permanently for specific destinations.
|
||||||
|
|
||||||
<b>SMTP DESTINATION SYNTAX</b>
|
<b>SMTP DESTINATION SYNTAX</b>
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations separated
|
The Postfix SMTP client supports multiple destinations separated by
|
||||||
by comma or whitespace (Postfix 3.5 and later). SMTP destinations have
|
comma or whitespace (Postfix 3.5 and later). Each destination is tried
|
||||||
the following form:
|
in the specified order.
|
||||||
|
|
||||||
|
SMTP destinations have the following form:
|
||||||
|
|
||||||
<i>domainname</i>
|
<i>domainname</i>
|
||||||
|
|
||||||
<i>domainname</i>:<i>port</i>
|
<i>domainname</i>:<i>service</i>
|
||||||
Look up the mail exchangers for the specified domain, and con-
|
Look up the mail exchangers for the specified domain, and con-
|
||||||
nect to the specified port (default: <b>smtp</b>).
|
nect to the specified service (default: <b>smtp</b>). Optionally, mail
|
||||||
|
exchangers may be looked up with SRV queries instead of MX; this
|
||||||
|
requires that <i>service</i> is given in symbolic form.
|
||||||
|
|
||||||
[<i>hostname</i>]
|
[<i>hostname</i>]
|
||||||
|
|
||||||
[<i>hostname</i>]:<i>port</i>
|
[<i>hostname</i>]:<i>service</i>
|
||||||
Look up the address(es) of the specified host, and connect to
|
Look up the address(es) for the specified host, and connect to
|
||||||
the specified port (default: <b>smtp</b>).
|
the specified service (default: <b>smtp</b>).
|
||||||
|
|
||||||
[<i>address</i>]
|
[<i>address</i>]
|
||||||
|
|
||||||
[<i>address</i>]:<i>port</i>
|
[<i>address</i>]:<i>service</i>
|
||||||
Connect to the host at the specified address, and connect to the
|
Connect to the host at the specified address, and connect to the
|
||||||
specified port (default: <b>smtp</b>). An IPv6 address must be format-
|
specified service (default: <b>smtp</b>). An IPv6 address must be for-
|
||||||
ted as [<b>ipv6</b>:<i>address</i>].
|
matted as [<b>ipv6</b>:<i>address</i>].
|
||||||
|
|
||||||
<b>LMTP DESTINATION SYNTAX</b>
|
<b>LMTP DESTINATION SYNTAX</b>
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations separated
|
The Postfix LMTP client supports multiple destinations separated by
|
||||||
by comma or whitespace (Postfix 3.5 and later). LMTP destinations have
|
comma or whitespace (Postfix 3.5 and later). Each destination is tried
|
||||||
the following form:
|
in the specified order.
|
||||||
|
|
||||||
|
LMTP destinations have the following form:
|
||||||
|
|
||||||
<b>unix</b>:<i>pathname</i>
|
<b>unix</b>:<i>pathname</i>
|
||||||
Connect to the local UNIX-domain server that is bound to the
|
Connect to the local UNIX-domain server that is bound to the
|
||||||
specified <i>pathname</i>. If the process runs chrooted, an absolute
|
specified <i>pathname</i>. If the process runs chrooted, an absolute
|
||||||
pathname is interpreted relative to the Postfix queue directory.
|
pathname is interpreted relative to the Postfix queue directory.
|
||||||
|
|
||||||
|
<b>inet</b>:<i>domainname</i>
|
||||||
|
|
||||||
|
<b>inet</b>:<i>domainname</i>:<i>service</i>
|
||||||
|
Look up the LMTP servers for the specified domain and service
|
||||||
|
(default: <b>lmtp</b>). This form is supported when SRV lookups are
|
||||||
|
enabled, and requires that <i>service</i> is in symbolic form.
|
||||||
|
|
||||||
<b>inet</b>:<i>hostname</i>
|
<b>inet</b>:<i>hostname</i>
|
||||||
|
|
||||||
<b>inet</b>:<i>hostname</i>:<i>port</i>
|
<b>inet</b>:<i>hostname</i>:<i>service</i>
|
||||||
|
Look up the address(es) for the specified host, and connect to
|
||||||
|
the specified service (default: <b>lmtp</b>). When SRV lookups are
|
||||||
|
enabled, use the form <b>[</b><i>hostname</i><b>]</b> to force address lookups.
|
||||||
|
|
||||||
<b>inet</b>:[<i>address</i>]
|
<b>inet</b>:[<i>address</i>]
|
||||||
|
|
||||||
<b>inet</b>:[<i>address</i>]:<i>port</i>
|
<b>inet</b>:[<i>address</i>]:<i>service</i>
|
||||||
Connect to the specified TCP port on the specified local or
|
Connect to the specified local or remote host and service
|
||||||
remote host. If no port is specified, connect to the port
|
(default: <b>lmtp</b>). An IPv6 address must be formatted as
|
||||||
defined as <b>lmtp</b> in <b>services</b>(4). If no such service is found,
|
|
||||||
the <b><a href="postconf.5.html#lmtp_tcp_port">lmtp_tcp_port</a></b> configuration parameter (default value of 24)
|
|
||||||
will be used. An IPv6 address must be formatted as
|
|
||||||
[<b>ipv6</b>:<i>address</i>].
|
[<b>ipv6</b>:<i>address</i>].
|
||||||
|
|
||||||
<b>SINGLE-RECIPIENT DELIVERY</b>
|
<b>SINGLE-RECIPIENT DELIVERY</b>
|
||||||
@ -140,10 +149,9 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
This feature is available as of Postfix 3.5.
|
This feature is available as of Postfix 3.5.
|
||||||
|
|
||||||
<b>SECURITY</b>
|
<b>SECURITY</b>
|
||||||
The SMTP+LMTP client is moderately security-sensitive. It
|
The SMTP+LMTP client is moderately security-sensitive. It talks to SMTP
|
||||||
talks to SMTP or LMTP servers and to DNS servers on the
|
or LMTP servers and to DNS servers on the network. The SMTP+LMTP client
|
||||||
network. The SMTP+LMTP client can be run chrooted at fixed
|
can be run chrooted at fixed low privilege.
|
||||||
low privilege.
|
|
||||||
|
|
||||||
<b>STANDARDS</b>
|
<b>STANDARDS</b>
|
||||||
<a href="https://tools.ietf.org/html/rfc821">RFC 821</a> (SMTP protocol)
|
<a href="https://tools.ietf.org/html/rfc821">RFC 821</a> (SMTP protocol)
|
||||||
|
@ -80,6 +80,18 @@ MYSQL_TABLE(5) MYSQL_TABLE(5)
|
|||||||
earlier Postfix versions, the default was chosen by the MySQL
|
earlier Postfix versions, the default was chosen by the MySQL
|
||||||
implementation (<b>utf8mb4</b> as of MySQL 8.0, <b>latin1</b> historically).
|
implementation (<b>utf8mb4</b> as of MySQL 8.0, <b>latin1</b> historically).
|
||||||
|
|
||||||
|
<b>idle_interval (default: 60)</b>
|
||||||
|
The number of seconds after which an idle database connection
|
||||||
|
will be closed.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
|
||||||
|
<b>retry_interval (default: 60)</b>
|
||||||
|
The number of seconds that a database connection will be skipped
|
||||||
|
after an error.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
|
||||||
<b>query</b> The SQL query template used to search the database, where <b>%s</b> is
|
<b>query</b> The SQL query template used to search the database, where <b>%s</b> is
|
||||||
a substitute for the address Postfix is trying to resolve, e.g.
|
a substitute for the address Postfix is trying to resolve, e.g.
|
||||||
query = SELECT replacement FROM aliases WHERE mailbox = '%s'
|
query = SELECT replacement FROM aliases WHERE mailbox = '%s'
|
||||||
|
@ -72,11 +72,24 @@ PGSQL_TABLE(5) PGSQL_TABLE(5)
|
|||||||
The encoding used by the database client. The default setting
|
The encoding used by the database client. The default setting
|
||||||
is:
|
is:
|
||||||
encoding = UTF8
|
encoding = UTF8
|
||||||
|
|
||||||
Historically, the database client was hard coded to use LATIN1
|
Historically, the database client was hard coded to use LATIN1
|
||||||
in an attempt to disable multibyte character support.
|
in an attempt to disable multibyte character support.
|
||||||
|
|
||||||
This feature is available in Postfix 3.8 and later.
|
This feature is available in Postfix 3.8 and later.
|
||||||
|
|
||||||
|
<b>idle_interval (default: 60)</b>
|
||||||
|
The number of seconds after which an idle database connection
|
||||||
|
will be closed.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
|
||||||
|
<b>retry_interval (default: 60)</b>
|
||||||
|
The number of seconds that a database connection will be skipped
|
||||||
|
after an error.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
|
||||||
<b>query</b> The SQL query template used to search the database, where <b>%s</b> is
|
<b>query</b> The SQL query template used to search the database, where <b>%s</b> is
|
||||||
a substitute for the address Postfix is trying to resolve, e.g.
|
a substitute for the address Postfix is trying to resolve, e.g.
|
||||||
query = SELECT replacement FROM aliases WHERE mailbox = '%s'
|
query = SELECT replacement FROM aliases WHERE mailbox = '%s'
|
||||||
|
@ -10313,11 +10313,12 @@ gateway host instead.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
In the case of SMTP or LMTP delivery, specify one or more destinations
|
In the case of SMTP delivery, specify one or more destinations in
|
||||||
in the form of a domain name, hostname, hostname:port, [hostname]:port,
|
the form of a domain name, hostname, hostname:service, [hostname]:service,
|
||||||
[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
|
[hostaddress] or [hostaddress]:service, separated by comma or whitespace.
|
||||||
The form [hostname] turns off MX lookups. Multiple destinations are
|
The form [hostname] turns off MX or SRV lookups. Multiple destinations
|
||||||
supported in Postfix 3.5 and later.
|
are supported in Postfix 3.5 and later. Each destination is tried
|
||||||
|
in the specified order.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -36,9 +36,9 @@ POSTLOGD(8) POSTLOGD(8)
|
|||||||
<a href="postqueue.1.html"><b>postqueue</b>(1)</a> and (Postfix >= 3.7) <a href="postlog.1.html"><b>postlog</b>(1)</a>.
|
<a href="postqueue.1.html"><b>postqueue</b>(1)</a> and (Postfix >= 3.7) <a href="postlog.1.html"><b>postlog</b>(1)</a>.
|
||||||
|
|
||||||
<b>CONFIGURATION PARAMETERS</b>
|
<b>CONFIGURATION PARAMETERS</b>
|
||||||
Changes to <a href="postconf.5.html"><b>main.cf</b></a> are picked up automatically, as <a href="postlogd.8.html"><b>postlogd</b>(8)</a> pro-
|
Changes to <a href="postconf.5.html"><b>main.cf</b></a> are not picked up automatically, because <a href="postlogd.8.html"><b>postlogd</b>(8)</a>
|
||||||
cesses run for only a limited amount of time. Use the command "<b>postfix</b>
|
terminates only after reaching the <b><a href="postconf.5.html#max_idle">max_idle</a></b> time limit. Use the com-
|
||||||
<b>reload</b>" to speed up a change.
|
mand "<b>postfix reload</b>" to speed up a change.
|
||||||
|
|
||||||
The text below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for
|
The text below provides only a parameter summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for
|
||||||
more details including examples.
|
more details including examples.
|
||||||
|
@ -29,13 +29,9 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
again at a later time. Delivery status reports are sent to the
|
again at a later time. Delivery status reports are sent to the
|
||||||
<a href="bounce.8.html"><b>bounce</b>(8)</a>, <a href="defer.8.html"><b>defer</b>(8)</a> or <a href="trace.8.html"><b>trace</b>(8)</a> daemon as appropriate.
|
<a href="bounce.8.html"><b>bounce</b>(8)</a>, <a href="defer.8.html"><b>defer</b>(8)</a> or <a href="trace.8.html"><b>trace</b>(8)</a> daemon as appropriate.
|
||||||
|
|
||||||
The SMTP+LMTP client looks up a list of mail exchanger addresses for
|
The server lookup strategy is different for SMTP and LMTP. The details
|
||||||
the destination host, sorts the list by preference, and connects to
|
are given below under in the sections "SMTP DESTINATION SYNTAX" and
|
||||||
each listed address until it finds a server that responds.
|
"LMTP DESTINATION SYNTAX".
|
||||||
|
|
||||||
When a server is not reachable, or when mail delivery fails due to a
|
|
||||||
recoverable error condition, the SMTP+LMTP client will try to deliver
|
|
||||||
the mail to an alternate host.
|
|
||||||
|
|
||||||
After a successful mail transaction, a connection may be saved to the
|
After a successful mail transaction, a connection may be saved to the
|
||||||
<a href="scache.8.html"><b>scache</b>(8)</a> connection cache server, so that it may be used by any
|
<a href="scache.8.html"><b>scache</b>(8)</a> connection cache server, so that it may be used by any
|
||||||
@ -46,51 +42,64 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
can be enabled permanently for specific destinations.
|
can be enabled permanently for specific destinations.
|
||||||
|
|
||||||
<b>SMTP DESTINATION SYNTAX</b>
|
<b>SMTP DESTINATION SYNTAX</b>
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations separated
|
The Postfix SMTP client supports multiple destinations separated by
|
||||||
by comma or whitespace (Postfix 3.5 and later). SMTP destinations have
|
comma or whitespace (Postfix 3.5 and later). Each destination is tried
|
||||||
the following form:
|
in the specified order.
|
||||||
|
|
||||||
|
SMTP destinations have the following form:
|
||||||
|
|
||||||
<i>domainname</i>
|
<i>domainname</i>
|
||||||
|
|
||||||
<i>domainname</i>:<i>port</i>
|
<i>domainname</i>:<i>service</i>
|
||||||
Look up the mail exchangers for the specified domain, and con-
|
Look up the mail exchangers for the specified domain, and con-
|
||||||
nect to the specified port (default: <b>smtp</b>).
|
nect to the specified service (default: <b>smtp</b>). Optionally, mail
|
||||||
|
exchangers may be looked up with SRV queries instead of MX; this
|
||||||
|
requires that <i>service</i> is given in symbolic form.
|
||||||
|
|
||||||
[<i>hostname</i>]
|
[<i>hostname</i>]
|
||||||
|
|
||||||
[<i>hostname</i>]:<i>port</i>
|
[<i>hostname</i>]:<i>service</i>
|
||||||
Look up the address(es) of the specified host, and connect to
|
Look up the address(es) for the specified host, and connect to
|
||||||
the specified port (default: <b>smtp</b>).
|
the specified service (default: <b>smtp</b>).
|
||||||
|
|
||||||
[<i>address</i>]
|
[<i>address</i>]
|
||||||
|
|
||||||
[<i>address</i>]:<i>port</i>
|
[<i>address</i>]:<i>service</i>
|
||||||
Connect to the host at the specified address, and connect to the
|
Connect to the host at the specified address, and connect to the
|
||||||
specified port (default: <b>smtp</b>). An IPv6 address must be format-
|
specified service (default: <b>smtp</b>). An IPv6 address must be for-
|
||||||
ted as [<b>ipv6</b>:<i>address</i>].
|
matted as [<b>ipv6</b>:<i>address</i>].
|
||||||
|
|
||||||
<b>LMTP DESTINATION SYNTAX</b>
|
<b>LMTP DESTINATION SYNTAX</b>
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations separated
|
The Postfix LMTP client supports multiple destinations separated by
|
||||||
by comma or whitespace (Postfix 3.5 and later). LMTP destinations have
|
comma or whitespace (Postfix 3.5 and later). Each destination is tried
|
||||||
the following form:
|
in the specified order.
|
||||||
|
|
||||||
|
LMTP destinations have the following form:
|
||||||
|
|
||||||
<b>unix</b>:<i>pathname</i>
|
<b>unix</b>:<i>pathname</i>
|
||||||
Connect to the local UNIX-domain server that is bound to the
|
Connect to the local UNIX-domain server that is bound to the
|
||||||
specified <i>pathname</i>. If the process runs chrooted, an absolute
|
specified <i>pathname</i>. If the process runs chrooted, an absolute
|
||||||
pathname is interpreted relative to the Postfix queue directory.
|
pathname is interpreted relative to the Postfix queue directory.
|
||||||
|
|
||||||
|
<b>inet</b>:<i>domainname</i>
|
||||||
|
|
||||||
|
<b>inet</b>:<i>domainname</i>:<i>service</i>
|
||||||
|
Look up the LMTP servers for the specified domain and service
|
||||||
|
(default: <b>lmtp</b>). This form is supported when SRV lookups are
|
||||||
|
enabled, and requires that <i>service</i> is in symbolic form.
|
||||||
|
|
||||||
<b>inet</b>:<i>hostname</i>
|
<b>inet</b>:<i>hostname</i>
|
||||||
|
|
||||||
<b>inet</b>:<i>hostname</i>:<i>port</i>
|
<b>inet</b>:<i>hostname</i>:<i>service</i>
|
||||||
|
Look up the address(es) for the specified host, and connect to
|
||||||
|
the specified service (default: <b>lmtp</b>). When SRV lookups are
|
||||||
|
enabled, use the form <b>[</b><i>hostname</i><b>]</b> to force address lookups.
|
||||||
|
|
||||||
<b>inet</b>:[<i>address</i>]
|
<b>inet</b>:[<i>address</i>]
|
||||||
|
|
||||||
<b>inet</b>:[<i>address</i>]:<i>port</i>
|
<b>inet</b>:[<i>address</i>]:<i>service</i>
|
||||||
Connect to the specified TCP port on the specified local or
|
Connect to the specified local or remote host and service
|
||||||
remote host. If no port is specified, connect to the port
|
(default: <b>lmtp</b>). An IPv6 address must be formatted as
|
||||||
defined as <b>lmtp</b> in <b>services</b>(4). If no such service is found,
|
|
||||||
the <b><a href="postconf.5.html#lmtp_tcp_port">lmtp_tcp_port</a></b> configuration parameter (default value of 24)
|
|
||||||
will be used. An IPv6 address must be formatted as
|
|
||||||
[<b>ipv6</b>:<i>address</i>].
|
[<b>ipv6</b>:<i>address</i>].
|
||||||
|
|
||||||
<b>SINGLE-RECIPIENT DELIVERY</b>
|
<b>SINGLE-RECIPIENT DELIVERY</b>
|
||||||
@ -140,10 +149,9 @@ SMTP,(LMTP) SMTP,(LMTP)
|
|||||||
This feature is available as of Postfix 3.5.
|
This feature is available as of Postfix 3.5.
|
||||||
|
|
||||||
<b>SECURITY</b>
|
<b>SECURITY</b>
|
||||||
The SMTP+LMTP client is moderately security-sensitive. It
|
The SMTP+LMTP client is moderately security-sensitive. It talks to SMTP
|
||||||
talks to SMTP or LMTP servers and to DNS servers on the
|
or LMTP servers and to DNS servers on the network. The SMTP+LMTP client
|
||||||
network. The SMTP+LMTP client can be run chrooted at fixed
|
can be run chrooted at fixed low privilege.
|
||||||
low privilege.
|
|
||||||
|
|
||||||
<b>STANDARDS</b>
|
<b>STANDARDS</b>
|
||||||
<a href="https://tools.ietf.org/html/rfc821">RFC 821</a> (SMTP protocol)
|
<a href="https://tools.ietf.org/html/rfc821">RFC 821</a> (SMTP protocol)
|
||||||
|
@ -97,6 +97,16 @@ This parameter is available with Postfix 3.9 and later.
|
|||||||
With earlier Postfix versions, the default was chosen by
|
With earlier Postfix versions, the default was chosen by
|
||||||
the MySQL implementation (\fButf8mb4\fR as of MySQL 8.0,
|
the MySQL implementation (\fButf8mb4\fR as of MySQL 8.0,
|
||||||
\fBlatin1\fR historically).
|
\fBlatin1\fR historically).
|
||||||
|
.IP "\fBidle_interval (default: 60)\fR"
|
||||||
|
The number of seconds after which an idle database connection
|
||||||
|
will be closed.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
.IP "\fBretry_interval (default: 60)\fR"
|
||||||
|
The number of seconds that a database connection will be
|
||||||
|
skipped after an error.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
.IP "\fBquery\fR"
|
.IP "\fBquery\fR"
|
||||||
The SQL query template used to search the database, where \fB%s\fR
|
The SQL query template used to search the database, where \fB%s\fR
|
||||||
is a substitute for the address Postfix is trying to resolve,
|
is a substitute for the address Postfix is trying to resolve,
|
||||||
|
@ -90,10 +90,21 @@ is:
|
|||||||
.nf
|
.nf
|
||||||
encoding = UTF8
|
encoding = UTF8
|
||||||
.fi
|
.fi
|
||||||
|
|
||||||
Historically, the database client was hard coded to use
|
Historically, the database client was hard coded to use
|
||||||
LATIN1 in an attempt to disable multibyte character support.
|
LATIN1 in an attempt to disable multibyte character support.
|
||||||
|
|
||||||
This feature is available in Postfix 3.8 and later.
|
This feature is available in Postfix 3.8 and later.
|
||||||
|
.IP "\fBidle_interval (default: 60)\fR"
|
||||||
|
The number of seconds after which an idle database connection
|
||||||
|
will be closed.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
|
.IP "\fBretry_interval (default: 60)\fR"
|
||||||
|
The number of seconds that a database connection will be
|
||||||
|
skipped after an error.
|
||||||
|
|
||||||
|
This feature is available in Postfix 3.9 and later.
|
||||||
.IP "\fBquery\fR"
|
.IP "\fBquery\fR"
|
||||||
The SQL query template used to search the database, where \fB%s\fR
|
The SQL query template used to search the database, where \fB%s\fR
|
||||||
is a substitute for the address Postfix is trying to resolve,
|
is a substitute for the address Postfix is trying to resolve,
|
||||||
|
@ -6531,11 +6531,12 @@ On an intranet, specify the organizational domain name. If your
|
|||||||
internal DNS uses no MX records, specify the name of the intranet
|
internal DNS uses no MX records, specify the name of the intranet
|
||||||
gateway host instead.
|
gateway host instead.
|
||||||
.PP
|
.PP
|
||||||
In the case of SMTP or LMTP delivery, specify one or more destinations
|
In the case of SMTP delivery, specify one or more destinations in
|
||||||
in the form of a domain name, hostname, hostname:port, [hostname]:port,
|
the form of a domain name, hostname, hostname:service, [hostname]:service,
|
||||||
[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
|
[hostaddress] or [hostaddress]:service, separated by comma or whitespace.
|
||||||
The form [hostname] turns off MX lookups. Multiple destinations are
|
The form [hostname] turns off MX or SRV lookups. Multiple destinations
|
||||||
supported in Postfix 3.5 and later.
|
are supported in Postfix 3.5 and later. Each destination is tried
|
||||||
|
in the specified order.
|
||||||
.PP
|
.PP
|
||||||
If you're connected via UUCP, see the UUCP_README file for useful
|
If you're connected via UUCP, see the UUCP_README file for useful
|
||||||
information.
|
information.
|
||||||
|
@ -41,10 +41,10 @@ set this permission on programs other than \fBpostdrop\fR(1),
|
|||||||
.nf
|
.nf
|
||||||
.ad
|
.ad
|
||||||
.fi
|
.fi
|
||||||
Changes to \fBmain.cf\fR are picked up automatically, as
|
Changes to \fBmain.cf\fR are not picked up automatically,
|
||||||
\fBpostlogd\fR(8) processes run for only a limited amount
|
because \fBpostlogd\fR(8) terminates only after reaching
|
||||||
of time. Use the command "\fBpostfix reload\fR" to speed
|
the \fBmax_idle\fR time limit.
|
||||||
up a change.
|
Use the command "\fBpostfix reload\fR" to speed up a change.
|
||||||
|
|
||||||
The text below provides only a parameter summary. See
|
The text below provides only a parameter summary. See
|
||||||
\fBpostconf\fR(5) for more details including examples.
|
\fBpostconf\fR(5) for more details including examples.
|
||||||
|
@ -29,13 +29,9 @@ be tried again at a later time. Delivery status reports are sent
|
|||||||
to the \fBbounce\fR(8), \fBdefer\fR(8) or \fBtrace\fR(8) daemon as
|
to the \fBbounce\fR(8), \fBdefer\fR(8) or \fBtrace\fR(8) daemon as
|
||||||
appropriate.
|
appropriate.
|
||||||
|
|
||||||
The SMTP+LMTP client looks up a list of mail exchanger addresses for
|
The server lookup strategy is different for SMTP and LMTP.
|
||||||
the destination host, sorts the list by preference, and connects
|
The details are given below under in the sections "SMTP
|
||||||
to each listed address until it finds a server that responds.
|
DESTINATION SYNTAX" and "LMTP DESTINATION SYNTAX".
|
||||||
|
|
||||||
When a server is not reachable, or when mail delivery fails due
|
|
||||||
to a recoverable error condition, the SMTP+LMTP client will try to
|
|
||||||
deliver the mail to an alternate host.
|
|
||||||
|
|
||||||
After a successful mail transaction, a connection may be saved
|
After a successful mail transaction, a connection may be saved
|
||||||
to the \fBscache\fR(8) connection cache server, so that it
|
to the \fBscache\fR(8) connection cache server, so that it
|
||||||
@ -50,43 +46,57 @@ specific destinations.
|
|||||||
.nf
|
.nf
|
||||||
.ad
|
.ad
|
||||||
.fi
|
.fi
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations
|
The Postfix SMTP client supports multiple destinations
|
||||||
separated by comma or whitespace (Postfix 3.5 and later).
|
separated by comma or whitespace (Postfix 3.5 and later).
|
||||||
|
Each destination is tried in the specified order.
|
||||||
|
|
||||||
SMTP destinations have the following form:
|
SMTP destinations have the following form:
|
||||||
.IP \fIdomainname\fR
|
.IP \fIdomainname\fR
|
||||||
.IP \fIdomainname\fR:\fIport\fR
|
.IP \fIdomainname\fR:\fIservice\fR
|
||||||
Look up the mail exchangers for the specified domain, and
|
Look up the mail exchangers for the specified domain, and
|
||||||
connect to the specified port (default: \fBsmtp\fR).
|
connect to the specified service (default: \fBsmtp\fR).
|
||||||
|
Optionally, mail exchangers may be looked up with SRV queries
|
||||||
|
instead of MX; this requires that \fIservice\fR is given
|
||||||
|
in symbolic form.
|
||||||
.IP [\fIhostname\fR]
|
.IP [\fIhostname\fR]
|
||||||
.IP [\fIhostname\fR]:\fIport\fR
|
.IP [\fIhostname\fR]:\fIservice\fR
|
||||||
Look up the address(es) of the specified host, and connect to
|
Look up the address(es) for the specified host, and connect to
|
||||||
the specified port (default: \fBsmtp\fR).
|
the specified service (default: \fBsmtp\fR).
|
||||||
.IP [\fIaddress\fR]
|
.IP [\fIaddress\fR]
|
||||||
.IP [\fIaddress\fR]:\fIport\fR
|
.IP [\fIaddress\fR]:\fIservice\fR
|
||||||
Connect to the host at the specified address, and connect
|
Connect to the host at the specified address, and connect
|
||||||
to the specified port (default: \fBsmtp\fR). An IPv6 address
|
to the specified service (default: \fBsmtp\fR). An IPv6 address
|
||||||
must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
||||||
.SH "LMTP DESTINATION SYNTAX"
|
.SH "LMTP DESTINATION SYNTAX"
|
||||||
.na
|
.na
|
||||||
.nf
|
.nf
|
||||||
.ad
|
.ad
|
||||||
.fi
|
.fi
|
||||||
The Postfix SMTP+LMTP client supports multiple destinations
|
The Postfix LMTP client supports multiple destinations
|
||||||
separated by comma or whitespace (Postfix 3.5 and later).
|
separated by comma or whitespace (Postfix 3.5 and later).
|
||||||
|
Each destination is tried in the specified order.
|
||||||
|
|
||||||
LMTP destinations have the following form:
|
LMTP destinations have the following form:
|
||||||
.IP \fBunix\fR:\fIpathname\fR
|
.IP \fBunix\fR:\fIpathname\fR
|
||||||
Connect to the local UNIX\-domain server that is bound to the specified
|
Connect to the local UNIX\-domain server that is bound to the specified
|
||||||
\fIpathname\fR. If the process runs chrooted, an absolute pathname
|
\fIpathname\fR. If the process runs chrooted, an absolute pathname
|
||||||
is interpreted relative to the Postfix queue directory.
|
is interpreted relative to the Postfix queue directory.
|
||||||
|
.IP \fBinet\fR:\fIdomainname\fR
|
||||||
|
.IP \fBinet\fR:\fIdomainname\fR:\fIservice\fR
|
||||||
|
Look up the LMTP servers for the specified domain and service
|
||||||
|
(default: \fBlmtp\fR).
|
||||||
|
This form is supported when SRV lookups are enabled, and
|
||||||
|
requires that \fIservice\fR is in symbolic form.
|
||||||
.IP \fBinet\fR:\fIhostname\fR
|
.IP \fBinet\fR:\fIhostname\fR
|
||||||
.IP \fBinet\fR:\fIhostname\fR:\fIport\fR
|
.IP \fBinet\fR:\fIhostname\fR:\fIservice\fR
|
||||||
|
Look up the address(es) for the specified host, and connect to
|
||||||
|
the specified service (default: \fBlmtp\fR). When SRV lookups
|
||||||
|
are enabled, use the form \fB[\fIhostname\fB]\fR to force
|
||||||
|
address lookups.
|
||||||
.IP \fBinet\fR:[\fIaddress\fR]
|
.IP \fBinet\fR:[\fIaddress\fR]
|
||||||
.IP \fBinet\fR:[\fIaddress\fR]:\fIport\fR
|
.IP \fBinet\fR:[\fIaddress\fR]:\fIservice\fR
|
||||||
Connect to the specified TCP port on the specified local or
|
Connect to the specified local or remote host and service
|
||||||
remote host. If no port is specified, connect to the port defined as
|
(default: \fBlmtp\fR).
|
||||||
\fBlmtp\fR in \fBservices\fR(4).
|
|
||||||
If no such service is found, the \fBlmtp_tcp_port\fR configuration
|
|
||||||
parameter (default value of 24) will be used.
|
|
||||||
An IPv6 address must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
An IPv6 address must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
||||||
.SH "SINGLE-RECIPIENT DELIVERY"
|
.SH "SINGLE-RECIPIENT DELIVERY"
|
||||||
.na
|
.na
|
||||||
@ -150,6 +160,8 @@ This feature is available as of Postfix 3.5.
|
|||||||
.SH "SECURITY"
|
.SH "SECURITY"
|
||||||
.na
|
.na
|
||||||
.nf
|
.nf
|
||||||
|
.ad
|
||||||
|
.fi
|
||||||
The SMTP+LMTP client is moderately security\-sensitive. It
|
The SMTP+LMTP client is moderately security\-sensitive. It
|
||||||
talks to SMTP or LMTP servers and to DNS servers on the
|
talks to SMTP or LMTP servers and to DNS servers on the
|
||||||
network. The SMTP+LMTP client can be run chrooted at fixed
|
network. The SMTP+LMTP client can be run chrooted at fixed
|
||||||
|
@ -87,6 +87,16 @@
|
|||||||
# With earlier Postfix versions, the default was chosen by
|
# With earlier Postfix versions, the default was chosen by
|
||||||
# the MySQL implementation (\fButf8mb4\fR as of MySQL 8.0,
|
# the MySQL implementation (\fButf8mb4\fR as of MySQL 8.0,
|
||||||
# \fBlatin1\fR historically).
|
# \fBlatin1\fR historically).
|
||||||
|
# .IP "\fBidle_interval (default: 60)\fR"
|
||||||
|
# The number of seconds after which an idle database connection
|
||||||
|
# will be closed.
|
||||||
|
#
|
||||||
|
# This feature is available in Postfix 3.9 and later.
|
||||||
|
# .IP "\fBretry_interval (default: 60)\fR"
|
||||||
|
# The number of seconds that a database connection will be
|
||||||
|
# skipped after an error.
|
||||||
|
#
|
||||||
|
# This feature is available in Postfix 3.9 and later.
|
||||||
# .IP "\fBquery\fR"
|
# .IP "\fBquery\fR"
|
||||||
# The SQL query template used to search the database, where \fB%s\fR
|
# The SQL query template used to search the database, where \fB%s\fR
|
||||||
# is a substitute for the address Postfix is trying to resolve,
|
# is a substitute for the address Postfix is trying to resolve,
|
||||||
|
@ -80,10 +80,21 @@
|
|||||||
# .nf
|
# .nf
|
||||||
# encoding = UTF8
|
# encoding = UTF8
|
||||||
# .fi
|
# .fi
|
||||||
|
#
|
||||||
# Historically, the database client was hard coded to use
|
# Historically, the database client was hard coded to use
|
||||||
# LATIN1 in an attempt to disable multibyte character support.
|
# LATIN1 in an attempt to disable multibyte character support.
|
||||||
#
|
#
|
||||||
# This feature is available in Postfix 3.8 and later.
|
# This feature is available in Postfix 3.8 and later.
|
||||||
|
# .IP "\fBidle_interval (default: 60)\fR"
|
||||||
|
# The number of seconds after which an idle database connection
|
||||||
|
# will be closed.
|
||||||
|
#
|
||||||
|
# This feature is available in Postfix 3.9 and later.
|
||||||
|
# .IP "\fBretry_interval (default: 60)\fR"
|
||||||
|
# The number of seconds that a database connection will be
|
||||||
|
# skipped after an error.
|
||||||
|
#
|
||||||
|
# This feature is available in Postfix 3.9 and later.
|
||||||
# .IP "\fBquery\fR"
|
# .IP "\fBquery\fR"
|
||||||
# The SQL query template used to search the database, where \fB%s\fR
|
# The SQL query template used to search the database, where \fB%s\fR
|
||||||
# is a substitute for the address Postfix is trying to resolve,
|
# is a substitute for the address Postfix is trying to resolve,
|
||||||
|
@ -3930,11 +3930,12 @@ gateway host instead.
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
In the case of SMTP or LMTP delivery, specify one or more destinations
|
In the case of SMTP delivery, specify one or more destinations in
|
||||||
in the form of a domain name, hostname, hostname:port, [hostname]:port,
|
the form of a domain name, hostname, hostname:service, [hostname]:service,
|
||||||
[hostaddress] or [hostaddress]:port, separated by comma or whitespace.
|
[hostaddress] or [hostaddress]:service, separated by comma or whitespace.
|
||||||
The form [hostname] turns off MX lookups. Multiple destinations are
|
The form [hostname] turns off MX or SRV lookups. Multiple destinations
|
||||||
supported in Postfix 3.5 and later.
|
are supported in Postfix 3.5 and later. Each destination is tried
|
||||||
|
in the specified order.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
@ -100,3 +100,10 @@ proto proto aliases proto virtual proto ADDRESS_REWRITING_README html
|
|||||||
names Files smtpd smtpd hc
|
names Files smtpd smtpd hc
|
||||||
or access control limitations Files smtpd smtpd hc
|
or access control limitations Files smtpd smtpd hc
|
||||||
spam the log with a warning message File tlsmgr tlsmgr c
|
spam the log with a warning message File tlsmgr tlsmgr c
|
||||||
|
Cleanup tlsmgr c fix 20240124 File tlsmgr tlsmgr c
|
||||||
|
MX or SRV records File smtp smtp c
|
||||||
|
a list of comma separated names Files smtpd smtpd hc
|
||||||
|
dnsblog dnsblog c postkick postkick c postlock postlock c
|
||||||
|
postdrop postdrop c postsuper postsuper c sendmail sendmail c
|
||||||
|
postlogd postlogd c
|
||||||
|
qmgr qmgr c qmqpd qmqpd c trivial rewrite trivial rewrite c
|
||||||
|
@ -353,3 +353,5 @@ standard lt CR gt lt LF gt br br This maintains compatibility
|
|||||||
br br This will also reject email from services that use BDAT
|
br br This will also reject email from services that use BDAT
|
||||||
RFC 2045 Sections 2 7 and 2 8 br br Such clients can be
|
RFC 2045 Sections 2 7 and 2 8 br br Such clients can be
|
||||||
to become a list of comma separated names br br This feature
|
to become a list of comma separated names br br This feature
|
||||||
|
the form of a domain name hostname hostname service hostname service
|
||||||
|
expected to become a list of comma separated names br br This
|
||||||
|
@ -152,6 +152,8 @@ typedef struct {
|
|||||||
char *password;
|
char *password;
|
||||||
char *dbname;
|
char *dbname;
|
||||||
char *charset;
|
char *charset;
|
||||||
|
int retry_interval;
|
||||||
|
int idle_interval;
|
||||||
ARGV *hosts;
|
ARGV *hosts;
|
||||||
PLMYSQL *pldb;
|
PLMYSQL *pldb;
|
||||||
HOST *active_host;
|
HOST *active_host;
|
||||||
@ -174,15 +176,15 @@ typedef struct {
|
|||||||
#define TYPEINET (1<<1)
|
#define TYPEINET (1<<1)
|
||||||
|
|
||||||
#define RETRY_CONN_MAX 100
|
#define RETRY_CONN_MAX 100
|
||||||
#define RETRY_CONN_INTV 60 /* 1 minute */
|
#define DEF_RETRY_INTV 60 /* 1 minute */
|
||||||
#define IDLE_CONN_INTV 60 /* 1 minute */
|
#define DEF_IDLE_INTV 60 /* 1 minute */
|
||||||
|
|
||||||
/* internal function declarations */
|
/* internal function declarations */
|
||||||
static PLMYSQL *plmysql_init(ARGV *);
|
static PLMYSQL *plmysql_init(ARGV *);
|
||||||
static int plmysql_query(DICT_MYSQL *, const char *, VSTRING *, MYSQL_RES **);
|
static int plmysql_query(DICT_MYSQL *, const char *, VSTRING *, MYSQL_RES **);
|
||||||
static void plmysql_dealloc(PLMYSQL *);
|
static void plmysql_dealloc(PLMYSQL *);
|
||||||
static void plmysql_close_host(HOST *);
|
static void plmysql_close_host(HOST *);
|
||||||
static void plmysql_down_host(HOST *);
|
static void plmysql_down_host(HOST *, int);
|
||||||
static void plmysql_connect_single(DICT_MYSQL *, HOST *);
|
static void plmysql_connect_single(DICT_MYSQL *, HOST *);
|
||||||
static const char *dict_mysql_lookup(DICT *, const char *);
|
static const char *dict_mysql_lookup(DICT *, const char *);
|
||||||
DICT *dict_mysql_open(const char *, int, int);
|
DICT *dict_mysql_open(const char *, int, int);
|
||||||
@ -476,7 +478,7 @@ static int plmysql_query(DICT_MYSQL *dict_mysql,
|
|||||||
name, 0, query, dict_mysql_quote);
|
name, 0, query, dict_mysql_quote);
|
||||||
/* Check for potential dict_mysql_quote() failure. */
|
/* Check for potential dict_mysql_quote() failure. */
|
||||||
if (host->stat == STATFAIL) {
|
if (host->stat == STATFAIL) {
|
||||||
plmysql_down_host(host);
|
plmysql_down_host(host, dict_mysql->retry_interval);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
@ -561,7 +563,7 @@ static int plmysql_query(DICT_MYSQL *dict_mysql,
|
|||||||
* See what we got.
|
* See what we got.
|
||||||
*/
|
*/
|
||||||
if (query_error) {
|
if (query_error) {
|
||||||
plmysql_down_host(host);
|
plmysql_down_host(host, dict_mysql->retry_interval);
|
||||||
if (errno == 0)
|
if (errno == 0)
|
||||||
errno = ENOTSUP;
|
errno = ENOTSUP;
|
||||||
if (first_result) {
|
if (first_result) {
|
||||||
@ -574,7 +576,7 @@ static int plmysql_query(DICT_MYSQL *dict_mysql,
|
|||||||
dict_mysql->dict.type, dict_mysql->dict.name,
|
dict_mysql->dict.type, dict_mysql->dict.name,
|
||||||
host->hostname);
|
host->hostname);
|
||||||
event_request_timer(dict_mysql_event, (void *) host,
|
event_request_timer(dict_mysql_event, (void *) host,
|
||||||
IDLE_CONN_INTV);
|
dict_mysql->idle_interval);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -618,7 +620,7 @@ static void plmysql_connect_single(DICT_MYSQL *dict_mysql, HOST *host)
|
|||||||
if (mysql_set_character_set(host->db, dict_mysql->charset) != 0) {
|
if (mysql_set_character_set(host->db, dict_mysql->charset) != 0) {
|
||||||
msg_warn("dict_mysql: mysql_set_character_set '%s' failed: %s",
|
msg_warn("dict_mysql: mysql_set_character_set '%s' failed: %s",
|
||||||
dict_mysql->charset, mysql_error(host->db));
|
dict_mysql->charset, mysql_error(host->db));
|
||||||
plmysql_down_host(host);
|
plmysql_down_host(host, dict_mysql->retry_interval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
@ -628,7 +630,7 @@ static void plmysql_connect_single(DICT_MYSQL *dict_mysql, HOST *host)
|
|||||||
} else {
|
} else {
|
||||||
msg_warn("connect to mysql server %s: %s",
|
msg_warn("connect to mysql server %s: %s",
|
||||||
host->hostname, mysql_error(host->db));
|
host->hostname, mysql_error(host->db));
|
||||||
plmysql_down_host(host);
|
plmysql_down_host(host, dict_mysql->retry_interval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -644,11 +646,11 @@ static void plmysql_close_host(HOST *host)
|
|||||||
* plmysql_down_host - close a failed connection AND set a "stay away from
|
* plmysql_down_host - close a failed connection AND set a "stay away from
|
||||||
* this host" timer
|
* this host" timer
|
||||||
*/
|
*/
|
||||||
static void plmysql_down_host(HOST *host)
|
static void plmysql_down_host(HOST *host, int retry_interval)
|
||||||
{
|
{
|
||||||
mysql_close(host->db);
|
mysql_close(host->db);
|
||||||
host->db = 0;
|
host->db = 0;
|
||||||
host->ts = time((time_t *) 0) + RETRY_CONN_INTV;
|
host->ts = time((time_t *) 0) + retry_interval;
|
||||||
host->stat = STATFAIL;
|
host->stat = STATFAIL;
|
||||||
event_cancel_timer(dict_mysql_event, (void *) host);
|
event_cancel_timer(dict_mysql_event, (void *) host);
|
||||||
}
|
}
|
||||||
@ -666,6 +668,10 @@ static void mysql_parse_config(DICT_MYSQL *dict_mysql, const char *mysqlcf)
|
|||||||
dict_mysql->password = cfg_get_str(p, "password", "", 0, 0);
|
dict_mysql->password = cfg_get_str(p, "password", "", 0, 0);
|
||||||
dict_mysql->dbname = cfg_get_str(p, "dbname", "", 1, 0);
|
dict_mysql->dbname = cfg_get_str(p, "dbname", "", 1, 0);
|
||||||
dict_mysql->charset = cfg_get_str(p, "charset", "utf8mb4", 1, 0);
|
dict_mysql->charset = cfg_get_str(p, "charset", "utf8mb4", 1, 0);
|
||||||
|
dict_mysql->retry_interval = cfg_get_int(p, "retry_interval",
|
||||||
|
DEF_RETRY_INTV, 1, 0);
|
||||||
|
dict_mysql->idle_interval = cfg_get_int(p, "idle_interval",
|
||||||
|
DEF_IDLE_INTV, 1, 0);
|
||||||
dict_mysql->result_format = cfg_get_str(p, "result_format", "%s", 1, 0);
|
dict_mysql->result_format = cfg_get_str(p, "result_format", "%s", 1, 0);
|
||||||
dict_mysql->option_file = cfg_get_str(p, "option_file", NULL, 0, 0);
|
dict_mysql->option_file = cfg_get_str(p, "option_file", NULL, 0, 0);
|
||||||
dict_mysql->option_group = cfg_get_str(p, "option_group", "client", 0, 0);
|
dict_mysql->option_group = cfg_get_str(p, "option_group", "client", 0, 0);
|
||||||
|
@ -111,8 +111,8 @@
|
|||||||
#define TYPECONNSTR (1<<2)
|
#define TYPECONNSTR (1<<2)
|
||||||
|
|
||||||
#define RETRY_CONN_MAX 100
|
#define RETRY_CONN_MAX 100
|
||||||
#define RETRY_CONN_INTV 60 /* 1 minute */
|
#define DEF_RETRY_INTV 60 /* 1 minute */
|
||||||
#define IDLE_CONN_INTV 60 /* 1 minute */
|
#define DEF_IDLE_INTV 60 /* 1 minute */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PGconn *db;
|
PGconn *db;
|
||||||
@ -140,6 +140,8 @@ typedef struct {
|
|||||||
char *password;
|
char *password;
|
||||||
char *dbname;
|
char *dbname;
|
||||||
char *encoding;
|
char *encoding;
|
||||||
|
int retry_interval;
|
||||||
|
int idle_interval;
|
||||||
char *table;
|
char *table;
|
||||||
ARGV *hosts;
|
ARGV *hosts;
|
||||||
PLPGSQL *pldb;
|
PLPGSQL *pldb;
|
||||||
@ -155,7 +157,7 @@ static PLPGSQL *plpgsql_init(ARGV *);
|
|||||||
static PGSQL_RES *plpgsql_query(DICT_PGSQL *, const char *, VSTRING *);
|
static PGSQL_RES *plpgsql_query(DICT_PGSQL *, const char *, VSTRING *);
|
||||||
static void plpgsql_dealloc(PLPGSQL *);
|
static void plpgsql_dealloc(PLPGSQL *);
|
||||||
static void plpgsql_close_host(HOST *);
|
static void plpgsql_close_host(HOST *);
|
||||||
static void plpgsql_down_host(HOST *);
|
static void plpgsql_down_host(HOST *, int);
|
||||||
static void plpgsql_connect_single(DICT_PGSQL *, HOST *);
|
static void plpgsql_connect_single(DICT_PGSQL *, HOST *);
|
||||||
static const char *dict_pgsql_lookup(DICT *, const char *);
|
static const char *dict_pgsql_lookup(DICT *, const char *);
|
||||||
DICT *dict_pgsql_open(const char *, int, int);
|
DICT *dict_pgsql_open(const char *, int, int);
|
||||||
@ -480,7 +482,7 @@ static PGSQL_RES *plpgsql_query(DICT_PGSQL *dict_pgsql,
|
|||||||
|
|
||||||
/* Check for potential dict_pgsql_quote() failure. */
|
/* Check for potential dict_pgsql_quote() failure. */
|
||||||
if (host->stat == STATFAIL) {
|
if (host->stat == STATFAIL) {
|
||||||
plpgsql_down_host(host);
|
plpgsql_down_host(host, dict_pgsql->retry_interval);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -518,7 +520,7 @@ static PGSQL_RES *plpgsql_query(DICT_PGSQL *dict_pgsql,
|
|||||||
msg_info("dict_pgsql: successful query from host %s",
|
msg_info("dict_pgsql: successful query from host %s",
|
||||||
host->hostname);
|
host->hostname);
|
||||||
event_request_timer(dict_pgsql_event, (void *) host,
|
event_request_timer(dict_pgsql_event, (void *) host,
|
||||||
IDLE_CONN_INTV);
|
dict_pgsql->idle_interval);
|
||||||
return (res);
|
return (res);
|
||||||
case PGRES_FATAL_ERROR:
|
case PGRES_FATAL_ERROR:
|
||||||
msg_warn("pgsql query failed: fatal error from host %s: %s",
|
msg_warn("pgsql query failed: fatal error from host %s: %s",
|
||||||
@ -549,7 +551,7 @@ static PGSQL_RES *plpgsql_query(DICT_PGSQL *dict_pgsql,
|
|||||||
*/
|
*/
|
||||||
if (res != 0)
|
if (res != 0)
|
||||||
PQclear(res);
|
PQclear(res);
|
||||||
plpgsql_down_host(host);
|
plpgsql_down_host(host, dict_pgsql->retry_interval);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (0);
|
return (0);
|
||||||
@ -572,13 +574,13 @@ static void plpgsql_connect_single(DICT_PGSQL *dict_pgsql, HOST *host)
|
|||||||
if (host->db == NULL || PQstatus(host->db) != CONNECTION_OK) {
|
if (host->db == NULL || PQstatus(host->db) != CONNECTION_OK) {
|
||||||
msg_warn("connect to pgsql server %s: %s",
|
msg_warn("connect to pgsql server %s: %s",
|
||||||
host->hostname, PQerrorMessage(host->db));
|
host->hostname, PQerrorMessage(host->db));
|
||||||
plpgsql_down_host(host);
|
plpgsql_down_host(host, dict_pgsql->retry_interval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (PQsetClientEncoding(host->db, dict_pgsql->encoding) != 0) {
|
if (PQsetClientEncoding(host->db, dict_pgsql->encoding) != 0) {
|
||||||
msg_warn("dict_pgsql: cannot set the encoding to %s, skipping %s",
|
msg_warn("dict_pgsql: cannot set the encoding to %s, skipping %s",
|
||||||
dict_pgsql->encoding, host->hostname);
|
dict_pgsql->encoding, host->hostname);
|
||||||
plpgsql_down_host(host);
|
plpgsql_down_host(host, dict_pgsql->retry_interval);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (msg_verbose)
|
if (msg_verbose)
|
||||||
@ -602,12 +604,12 @@ static void plpgsql_close_host(HOST *host)
|
|||||||
* plpgsql_down_host - close a failed connection AND set a "stay away from
|
* plpgsql_down_host - close a failed connection AND set a "stay away from
|
||||||
* this host" timer.
|
* this host" timer.
|
||||||
*/
|
*/
|
||||||
static void plpgsql_down_host(HOST *host)
|
static void plpgsql_down_host(HOST *host, int retry_interval)
|
||||||
{
|
{
|
||||||
if (host->db)
|
if (host->db)
|
||||||
PQfinish(host->db);
|
PQfinish(host->db);
|
||||||
host->db = 0;
|
host->db = 0;
|
||||||
host->ts = time((time_t *) 0) + RETRY_CONN_INTV;
|
host->ts = time((time_t *) 0) + retry_interval;
|
||||||
host->stat = STATFAIL;
|
host->stat = STATFAIL;
|
||||||
event_cancel_timer(dict_pgsql_event, (void *) host);
|
event_cancel_timer(dict_pgsql_event, (void *) host);
|
||||||
}
|
}
|
||||||
@ -626,6 +628,10 @@ static void pgsql_parse_config(DICT_PGSQL *dict_pgsql, const char *pgsqlcf)
|
|||||||
dict_pgsql->password = cfg_get_str(p, "password", "", 0, 0);
|
dict_pgsql->password = cfg_get_str(p, "password", "", 0, 0);
|
||||||
dict_pgsql->dbname = cfg_get_str(p, "dbname", "", 1, 0);
|
dict_pgsql->dbname = cfg_get_str(p, "dbname", "", 1, 0);
|
||||||
dict_pgsql->encoding = cfg_get_str(p, "encoding", "UTF8", 1, 0);
|
dict_pgsql->encoding = cfg_get_str(p, "encoding", "UTF8", 1, 0);
|
||||||
|
dict_pgsql->retry_interval = cfg_get_int(p, "retry_interval",
|
||||||
|
DEF_RETRY_INTV, 1, 0);
|
||||||
|
dict_pgsql->idle_interval = cfg_get_int(p, "idle_interval",
|
||||||
|
DEF_IDLE_INTV, 1, 0);
|
||||||
dict_pgsql->result_format = cfg_get_str(p, "result_format", "%s", 1, 0);
|
dict_pgsql->result_format = cfg_get_str(p, "result_format", "%s", 1, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
* Patches change both the patchlevel and the release date. Snapshots have no
|
* Patches change both the patchlevel and the release date. Snapshots have no
|
||||||
* patchlevel; they change the release date only.
|
* patchlevel; they change the release date only.
|
||||||
*/
|
*/
|
||||||
#define MAIL_RELEASE_DATE "20240125"
|
#define MAIL_RELEASE_DATE "20240129"
|
||||||
#define MAIL_VERSION_NUMBER "3.9"
|
#define MAIL_VERSION_NUMBER "3.9"
|
||||||
|
|
||||||
#ifdef SNAPSHOT
|
#ifdef SNAPSHOT
|
||||||
|
@ -31,10 +31,10 @@
|
|||||||
/* CONFIGURATION PARAMETERS
|
/* CONFIGURATION PARAMETERS
|
||||||
/* .ad
|
/* .ad
|
||||||
/* .fi
|
/* .fi
|
||||||
/* Changes to \fBmain.cf\fR are picked up automatically, as
|
/* Changes to \fBmain.cf\fR are not picked up automatically,
|
||||||
/* \fBpostlogd\fR(8) processes run for only a limited amount
|
/* because \fBpostlogd\fR(8) terminates only after reaching
|
||||||
/* of time. Use the command "\fBpostfix reload\fR" to speed
|
/* the \fBmax_idle\fR time limit.
|
||||||
/* up a change.
|
/* Use the command "\fBpostfix reload\fR" to speed up a change.
|
||||||
/*
|
/*
|
||||||
/* The text below provides only a parameter summary. See
|
/* The text below provides only a parameter summary. See
|
||||||
/* \fBpostconf\fR(5) for more details including examples.
|
/* \fBpostconf\fR(5) for more details including examples.
|
||||||
|
@ -23,13 +23,9 @@
|
|||||||
/* to the \fBbounce\fR(8), \fBdefer\fR(8) or \fBtrace\fR(8) daemon as
|
/* to the \fBbounce\fR(8), \fBdefer\fR(8) or \fBtrace\fR(8) daemon as
|
||||||
/* appropriate.
|
/* appropriate.
|
||||||
/*
|
/*
|
||||||
/* The SMTP+LMTP client looks up a list of mail exchanger addresses for
|
/* The server lookup strategy is different for SMTP and LMTP.
|
||||||
/* the destination host, sorts the list by preference, and connects
|
/* The details are given below under in the sections "SMTP
|
||||||
/* to each listed address until it finds a server that responds.
|
/* DESTINATION SYNTAX" and "LMTP DESTINATION SYNTAX".
|
||||||
/*
|
|
||||||
/* When a server is not reachable, or when mail delivery fails due
|
|
||||||
/* to a recoverable error condition, the SMTP+LMTP client will try to
|
|
||||||
/* deliver the mail to an alternate host.
|
|
||||||
/*
|
/*
|
||||||
/* After a successful mail transaction, a connection may be saved
|
/* After a successful mail transaction, a connection may be saved
|
||||||
/* to the \fBscache\fR(8) connection cache server, so that it
|
/* to the \fBscache\fR(8) connection cache server, so that it
|
||||||
@ -42,41 +38,55 @@
|
|||||||
/* SMTP DESTINATION SYNTAX
|
/* SMTP DESTINATION SYNTAX
|
||||||
/* .ad
|
/* .ad
|
||||||
/* .fi
|
/* .fi
|
||||||
/* The Postfix SMTP+LMTP client supports multiple destinations
|
/* The Postfix SMTP client supports multiple destinations
|
||||||
/* separated by comma or whitespace (Postfix 3.5 and later).
|
/* separated by comma or whitespace (Postfix 3.5 and later).
|
||||||
|
/* Each destination is tried in the specified order.
|
||||||
|
/*
|
||||||
/* SMTP destinations have the following form:
|
/* SMTP destinations have the following form:
|
||||||
/* .IP \fIdomainname\fR
|
/* .IP \fIdomainname\fR
|
||||||
/* .IP \fIdomainname\fR:\fIport\fR
|
/* .IP \fIdomainname\fR:\fIservice\fR
|
||||||
/* Look up the mail exchangers for the specified domain, and
|
/* Look up the mail exchangers for the specified domain, and
|
||||||
/* connect to the specified port (default: \fBsmtp\fR).
|
/* connect to the specified service (default: \fBsmtp\fR).
|
||||||
|
/* Optionally, mail exchangers may be looked up with SRV queries
|
||||||
|
/* instead of MX; this requires that \fIservice\fR is given
|
||||||
|
/* in symbolic form.
|
||||||
/* .IP [\fIhostname\fR]
|
/* .IP [\fIhostname\fR]
|
||||||
/* .IP [\fIhostname\fR]:\fIport\fR
|
/* .IP [\fIhostname\fR]:\fIservice\fR
|
||||||
/* Look up the address(es) of the specified host, and connect to
|
/* Look up the address(es) for the specified host, and connect to
|
||||||
/* the specified port (default: \fBsmtp\fR).
|
/* the specified service (default: \fBsmtp\fR).
|
||||||
/* .IP [\fIaddress\fR]
|
/* .IP [\fIaddress\fR]
|
||||||
/* .IP [\fIaddress\fR]:\fIport\fR
|
/* .IP [\fIaddress\fR]:\fIservice\fR
|
||||||
/* Connect to the host at the specified address, and connect
|
/* Connect to the host at the specified address, and connect
|
||||||
/* to the specified port (default: \fBsmtp\fR). An IPv6 address
|
/* to the specified service (default: \fBsmtp\fR). An IPv6 address
|
||||||
/* must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
/* must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
||||||
/* LMTP DESTINATION SYNTAX
|
/* LMTP DESTINATION SYNTAX
|
||||||
/* .ad
|
/* .ad
|
||||||
/* .fi
|
/* .fi
|
||||||
/* The Postfix SMTP+LMTP client supports multiple destinations
|
/* The Postfix LMTP client supports multiple destinations
|
||||||
/* separated by comma or whitespace (Postfix 3.5 and later).
|
/* separated by comma or whitespace (Postfix 3.5 and later).
|
||||||
|
/* Each destination is tried in the specified order.
|
||||||
|
/*
|
||||||
/* LMTP destinations have the following form:
|
/* LMTP destinations have the following form:
|
||||||
/* .IP \fBunix\fR:\fIpathname\fR
|
/* .IP \fBunix\fR:\fIpathname\fR
|
||||||
/* Connect to the local UNIX-domain server that is bound to the specified
|
/* Connect to the local UNIX-domain server that is bound to the specified
|
||||||
/* \fIpathname\fR. If the process runs chrooted, an absolute pathname
|
/* \fIpathname\fR. If the process runs chrooted, an absolute pathname
|
||||||
/* is interpreted relative to the Postfix queue directory.
|
/* is interpreted relative to the Postfix queue directory.
|
||||||
|
/* .IP \fBinet\fR:\fIdomainname\fR
|
||||||
|
/* .IP \fBinet\fR:\fIdomainname\fR:\fIservice\fR
|
||||||
|
/* Look up the LMTP servers for the specified domain and service
|
||||||
|
/* (default: \fBlmtp\fR).
|
||||||
|
/* This form is supported when SRV lookups are enabled, and
|
||||||
|
/* requires that \fIservice\fR is in symbolic form.
|
||||||
/* .IP \fBinet\fR:\fIhostname\fR
|
/* .IP \fBinet\fR:\fIhostname\fR
|
||||||
/* .IP \fBinet\fR:\fIhostname\fR:\fIport\fR
|
/* .IP \fBinet\fR:\fIhostname\fR:\fIservice\fR
|
||||||
|
/* Look up the address(es) for the specified host, and connect to
|
||||||
|
/* the specified service (default: \fBlmtp\fR). When SRV lookups
|
||||||
|
/* are enabled, use the form \fB[\fIhostname\fB]\fR to force
|
||||||
|
/* address lookups.
|
||||||
/* .IP \fBinet\fR:[\fIaddress\fR]
|
/* .IP \fBinet\fR:[\fIaddress\fR]
|
||||||
/* .IP \fBinet\fR:[\fIaddress\fR]:\fIport\fR
|
/* .IP \fBinet\fR:[\fIaddress\fR]:\fIservice\fR
|
||||||
/* Connect to the specified TCP port on the specified local or
|
/* Connect to the specified local or remote host and service
|
||||||
/* remote host. If no port is specified, connect to the port defined as
|
/* (default: \fBlmtp\fR).
|
||||||
/* \fBlmtp\fR in \fBservices\fR(4).
|
|
||||||
/* If no such service is found, the \fBlmtp_tcp_port\fR configuration
|
|
||||||
/* parameter (default value of 24) will be used.
|
|
||||||
/* An IPv6 address must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
/* An IPv6 address must be formatted as [\fBipv6\fR:\fIaddress\fR].
|
||||||
/* SINGLE-RECIPIENT DELIVERY
|
/* SINGLE-RECIPIENT DELIVERY
|
||||||
/* .ad
|
/* .ad
|
||||||
@ -134,6 +144,8 @@
|
|||||||
/* This feature is available as of Postfix 3.5.
|
/* This feature is available as of Postfix 3.5.
|
||||||
/* .RE
|
/* .RE
|
||||||
/* SECURITY
|
/* SECURITY
|
||||||
|
/* .ad
|
||||||
|
/* .fi
|
||||||
/* The SMTP+LMTP client is moderately security-sensitive. It
|
/* The SMTP+LMTP client is moderately security-sensitive. It
|
||||||
/* talks to SMTP or LMTP servers and to DNS servers on the
|
/* talks to SMTP or LMTP servers and to DNS servers on the
|
||||||
/* network. The SMTP+LMTP client can be run chrooted at fixed
|
/* network. The SMTP+LMTP client can be run chrooted at fixed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user