2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-09-03 23:55:18 +00:00

postfix-2.12-20140929

This commit is contained in:
Wietse Venema
2014-09-29 00:00:00 -05:00
committed by Viktor Dukhovni
parent 30e06f4e22
commit 8ef4889277
16 changed files with 286 additions and 224 deletions

View File

@@ -20506,3 +20506,18 @@ Apologies for any names omitted.
non-ASCII cruft into the HTML-ized manpages. Files: non-ASCII cruft into the HTML-ized manpages. Files:
html/Makefile.in, proto/Makefile.in, many HTML output html/Makefile.in, proto/Makefile.in, many HTML output
files. files.
20140929
Cleanup: the table-driven code for per-Milter and per-policy
overrides now updates arbitrary variables, so that it can also
be used for, say, TLS policies. Files: global/attr_override.[hc],
smtpd/smtpd_check.c, milter/milter.c.
Documentation: support for "{ argument with whitespace }"
in master(5) and pipe(8). Files: proto/master, src/pipe/pipe.c.
Documentation: in ADDRES_VERIFY_README, replaced "nearest
MTA" with "preferred MTA". The SMTP client was changed years
ago to try alternate MXes after a 4XX SMTP server response.
File: proto/ADDRES_VERIFY_README.html.

View File

@@ -41,11 +41,11 @@ Topics covered in this document:
HHooww aaddddrreessss vveerriiffiiccaattiioonn wwoorrkkss HHooww aaddddrreessss vveerriiffiiccaattiioonn wwoorrkkss
A Postfix MTA verifies a sender or recipient address by probing the nearest MTA A Postfix MTA verifies a sender or recipient address by probing the preferred
for that address, without actually delivering mail. The nearest MTA could be MTAs for that address, without actually delivering mail. The preferred MTAs
the Postfix MTA itself, or it could be a remote MTA (SMTP interruptus). Probe could include the Postfix MTA itself, or some remote MTAs (SMTP interruptus).
messages are like normal mail, except that they are never delivered, deferred Probe messages are like normal mail, except that they are never delivered,
or bounced; probe messages are always discarded. deferred or bounced; probe messages are always discarded.
probe Postfix probe Postfix
@@ -81,12 +81,11 @@ postconf(5) for details.
LLiimmiittaattiioonnss ooff aaddddrreessss vveerriiffiiccaattiioonn LLiimmiittaattiioonnss ooff aaddddrreessss vveerriiffiiccaattiioonn
* When verifying a remote address, Postfix probes the nearest MTA for that * When verifying a remote address, Postfix probes the preferred MTAs for that
address, without actually delivering mail to it. If the nearest MTA accepts address, without actually delivering mail. If a preferred MTA accepts the
the address, then Postfix assumes that the address is deliverable. In address, then Postfix assumes that the address is deliverable. In reality,
reality, mail for a remote address can bounce AFTER the nearest MTA accepts mail for a remote address can bounce AFTER a preferred MTA accepts the
the recipient address, or AFTER the nearest MTA accepts the message recipient address, or AFTER a preferred MTA accepts the message content.
content.
* Some sites may blacklist you when you are probing them too often (a probe * Some sites may blacklist you when you are probing them too often (a probe
is an SMTP session that does not deliver mail), or when you are probing is an SMTP session that does not deliver mail), or when you are probing
@@ -101,10 +100,10 @@ LLiimmiittaattiioonnss ooff aaddddrreessss vveerriiffi
to override mail routing and for possible limitations when you have to do to override mail routing and for possible limitations when you have to do
this. this.
* Postfix assumes that an address is undeliverable when the nearest MTA for * Postfix assumes that an address is undeliverable when a preferred MTA for
the address rejects the probe, regardless of the reason for rejection the address rejects the probe, regardless of the reason for rejection
(client rejected, HELO rejected, MAIL FROM rejected, etc.). Thus, Postfix (client rejected, HELO rejected, MAIL FROM rejected, etc.). Thus, Postfix
rejects an address when the nearest MTA for that address rejects mail from rejects an address when a preferred MTA for that address rejects mail from
your machine for any reason. This is not a limitation, but it is mentioned your machine for any reason. This is not a limitation, but it is mentioned
here just in case people believe that it is a limitation. here just in case people believe that it is a limitation.

View File

@@ -44,6 +44,8 @@ about build options that are not described in the INSTALL instructions.
Major changes with snapshot 20140928 Major changes with snapshot 20140928
==================================== ====================================
Per-Milter settings
-------------------
Support for per-Milter settings that override main.cf parameters. Support for per-Milter settings that override main.cf parameters.
For details see the section "Advanced policy client configuration" For details see the section "Advanced policy client configuration"
in the SMTPD_POLICY_README document. in the SMTPD_POLICY_README document.
@@ -62,6 +64,8 @@ content_timeout, default_action, and protocol. These have the same
names as the corresponding main.cf parameters, without the "milter_" names as the corresponding main.cf parameters, without the "milter_"
prefix. prefix.
Per-policy service settings
---------------------------
Support for per-policy service settings that override main.cf Support for per-policy service settings that override main.cf
parameters. For details see the section "Different settings for parameters. For details see the section "Different settings for
different Milter applications" in the MILTER_README document. different Milter applications" in the MILTER_README document.
@@ -82,6 +86,21 @@ request_limit, retry_delay, timeout, try_limit. These have the same
names as the corresponding main.cf parameters, without the names as the corresponding main.cf parameters, without the
"smtpd_policy_service_" prefix. "smtpd_policy_service_" prefix.
Whitespace in master.cf command-line arguments
----------------------------------------------
Support for whitespace in daemon command-line arguments. For details, see
the "Command name + arguments" section in the master(5) manpage.
Example:
smtpd -o { parameter = value containing whitespace } ...
The { ... } form is also available for non-option command-line
arguments in master.cf, for example:
pipe ... argv=command { argument containing whitespace } ...
In both cases, whitespace immediately after "{" and before "}"
is ignored.
Major changes with snapshot 20140921 Major changes with snapshot 20140921
==================================== ====================================

View File

@@ -75,9 +75,9 @@ verification probes</a>
<h2><a name="how">How address verification works</a></h2> <h2><a name="how">How address verification works</a></h2>
<p> A Postfix MTA verifies a sender or recipient address by probing <p> A Postfix MTA verifies a sender or recipient address by probing
the nearest the preferred MTAs
MTA for that address, without actually delivering mail. The nearest for that address, without actually delivering mail. The preferred
MTA could be the Postfix MTA itself, or it could be a remote MTA MTAs could include the Postfix MTA itself, or some remote MTAs
(SMTP (SMTP
interruptus). Probe messages are like normal mail, except that interruptus). Probe messages are like normal mail, except that
they are never delivered, deferred or bounced; probe messages are they are never delivered, deferred or bounced; probe messages are
@@ -198,12 +198,12 @@ details. </p>
<ul> <ul>
<li> <p> When verifying a remote address, Postfix probes the nearest <li> <p> When verifying a remote address, Postfix probes the preferred
MTA for that address, without actually delivering mail to it. If MTAs for that address, without actually delivering mail. If
the nearest MTA accepts the address, then Postfix assumes that the a preferred MTA accepts the address, then Postfix assumes that the
address is deliverable. In reality, mail for a remote address can address is deliverable. In reality, mail for a remote address can
bounce AFTER the nearest MTA accepts the recipient address, or AFTER bounce AFTER a preferred MTA accepts the recipient address, or AFTER
the nearest MTA accepts the message content. </p> a preferred MTA accepts the message content. </p>
<li> <p> Some sites may blacklist you when you are probing them <li> <p> Some sites may blacklist you when you are probing them
too often (a probe is an SMTP session that does not deliver mail), too often (a probe is an SMTP session that does not deliver mail),
@@ -219,10 +219,10 @@ the routing of address verification probes"</a>, for how to override
mail routing and for possible limitations when you have to do this. mail routing and for possible limitations when you have to do this.
</p> </p>
<li> <p> Postfix assumes that an address is undeliverable when the <li> <p> Postfix assumes that an address is undeliverable when a
nearest MTA for the address rejects the probe, regardless of the preferred MTA for the address rejects the probe, regardless of the
reason for rejection (client rejected, HELO rejected, MAIL FROM reason for rejection (client rejected, HELO rejected, MAIL FROM
rejected, etc.). Thus, Postfix rejects an address when the nearest rejected, etc.). Thus, Postfix rejects an address when a preferred
MTA for that address rejects mail from your machine for any reason. MTA for that address rejects mail from your machine for any reason.
This is not a limitation, but it is mentioned here just in case This is not a limitation, but it is mentioned here just in case
people believe that it is a limitation. </p> people believe that it is a limitation. </p>

View File

@@ -163,31 +163,35 @@ MASTER(5) MASTER(5)
The command to be executed. Characters that are special to the The command to be executed. Characters that are special to the
shell such as "&gt;" or "|" have no special meaning here, and shell such as "&gt;" or "|" have no special meaning here, and
quotes cannot be used to protect arguments containing white- quotes cannot be used to protect arguments containing white-
space. space. To protect whitespace, use "{" and "}" as described
below.
The command name is relative to the Postfix daemon directory The command name is relative to the Postfix daemon directory
(pathname is controlled by the <b><a href="postconf.5.html#daemon_directory">daemon_directory</a></b> configuration (pathname is controlled by the <b><a href="postconf.5.html#daemon_directory">daemon_directory</a></b> configuration
variable). variable).
The command argument syntax for specific commands is specified The command argument syntax for specific commands is specified
in the respective daemon manual page. in the respective daemon manual page.
The following command-line options have the same effect for all The following command-line options have the same effect for all
daemon programs: daemon programs:
<b>-D</b> Run the daemon under control by the command specified <b>-D</b> Run the daemon under control by the command specified
with the <b><a href="postconf.5.html#debugger_command">debugger_command</a></b> variable in the <a href="postconf.5.html">main.cf</a> config- with the <b><a href="postconf.5.html#debugger_command">debugger_command</a></b> variable in the <a href="postconf.5.html">main.cf</a> config-
uration file. See <a href="DEBUG_README.html">DEBUG_README</a> for hints and tips. uration file. See <a href="DEBUG_README.html">DEBUG_README</a> for hints and tips.
<b>-o</b> <i>name</i>=<i>value</i> <b>-o</b> <i>name</i>=<i>value</i> (short form)
Override the named <a href="postconf.5.html">main.cf</a> configuration parameter. The
parameter value can refer to other parameters as <i>$name</i>
etc., just like in <a href="postconf.5.html">main.cf</a>. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
NOTE 1: do not specify whitespace around the "=" or in <b>-o {</b> <i>name</i> = <i>value</i> <b>}</b> (Postfix 2.12 and later)
parameter values. To specify a parameter value that con- Override the named <a href="postconf.5.html">main.cf</a> configuration parameter. The
tains whitespace, use commas instead of spaces, or spec- parameter value can refer to other parameters as <i>$name</i>
ify the value in <a href="postconf.5.html">main.cf</a>. Example: etc., just like in <a href="postconf.5.html">main.cf</a>. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for syntax.
NOTE 1: with the "short form" shown above, do not specify
whitespace around the "=" or in parameter values. To
specify a parameter value that contains whitespace, use
commas instead of spaces, or specify the value in
<a href="postconf.5.html">main.cf</a>. Example:
/etc/postfix/<a href="master.5.html">master.cf</a>: /etc/postfix/<a href="master.5.html">master.cf</a>:
submission inet .... smtpd submission inet .... smtpd
@@ -206,6 +210,11 @@ MASTER(5) MASTER(5)
options to make a Postfix daemon process increasingly options to make a Postfix daemon process increasingly
verbose. verbose.
Other command-line arguments
Specify "{" and "}" around command arguments that contain
whitespace (Postfix 2.12 and later). Whitespace immedi-
ately after "{" and before "}" is ignored.
<b>SEE ALSO</b> <b>SEE ALSO</b>
<a href="master.8.html">master(8)</a>, process manager <a href="master.8.html">master(8)</a>, process manager
<a href="postconf.5.html">postconf(5)</a>, configuration parameters <a href="postconf.5.html">postconf(5)</a>, configuration parameters

View File

@@ -191,20 +191,25 @@ PIPE(8) PIPE(8)
out interpretation of shell meta characters by a shell command out interpretation of shell meta characters by a shell command
interpreter. interpreter.
Specify "{" and "}" around command arguments that contain white-
space (Postfix 2.12 and later). Whitespace immediately after "{"
and before "}" is ignored.
In the command argument vector, the following macros are recog- In the command argument vector, the following macros are recog-
nized and replaced with corresponding information from the Post- nized and replaced with corresponding information from the Post-
fix queue manager delivery request. fix queue manager delivery request.
In addition to the form ${<i>name</i>}, the forms $<i>name</i> and $(<i>name</i>) are In addition to the form ${<i>name</i>}, the forms $<i>name</i> and the depre-
also recognized. Specify <b>$$</b> where a single <b>$</b> is wanted. cated form $(<i>name</i>) are also recognized. Specify <b>$$</b> where a sin-
gle <b>$</b> is wanted.
<b>${client_address}</b> <b>${client_address}</b>
This macro expands to the remote client network address. This macro expands to the remote client network address.
This feature is available as of Postfix 2.2. This feature is available as of Postfix 2.2.
<b>${client_helo}</b> <b>${client_helo}</b>
This macro expands to the remote client HELO command This macro expands to the remote client HELO command
parameter. parameter.
This feature is available as of Postfix 2.2. This feature is available as of Postfix 2.2.
@@ -215,7 +220,7 @@ PIPE(8) PIPE(8)
This feature is available as of Postfix 2.2. This feature is available as of Postfix 2.2.
<b>${client_port}</b> <b>${client_port}</b>
This macro expands to the remote client TCP port number. This macro expands to the remote client TCP port number.
This feature is available as of Postfix 2.5. This feature is available as of Postfix 2.5.
@@ -226,7 +231,7 @@ PIPE(8) PIPE(8)
<b>${domain}</b> <b>${domain}</b>
This macro expands to the domain portion of the recipient This macro expands to the domain portion of the recipient
address. For example, with an address <i>user+foo@domain</i> address. For example, with an address <i>user+foo@domain</i>
the domain is <i>domain</i>. the domain is <i>domain</i>.
This information is modified by the <b>h</b> flag for case fold- This information is modified by the <b>h</b> flag for case fold-
@@ -235,12 +240,12 @@ PIPE(8) PIPE(8)
This feature is available as of Postfix 2.5. This feature is available as of Postfix 2.5.
<b>${extension}</b> <b>${extension}</b>
This macro expands to the extension part of a recipient This macro expands to the extension part of a recipient
address. For example, with an address <i>user+foo@domain</i> address. For example, with an address <i>user+foo@domain</i>
the extension is <i>foo</i>. the extension is <i>foo</i>.
A command-line argument that contains <b>${extension}</b> A command-line argument that contains <b>${extension}</b>
expands into as many command-line arguments as there are expands into as many command-line arguments as there are
recipients. recipients.
This information is modified by the <b>u</b> flag for case fold- This information is modified by the <b>u</b> flag for case fold-
@@ -248,11 +253,11 @@ PIPE(8) PIPE(8)
<b>${mailbox}</b> <b>${mailbox}</b>
This macro expands to the complete local part of a recip- This macro expands to the complete local part of a recip-
ient address. For example, with an address ient address. For example, with an address
<i>user+foo@domain</i> the mailbox is <i>user+foo</i>. <i>user+foo@domain</i> the mailbox is <i>user+foo</i>.
A command-line argument that contains <b>${mailbox}</b> expands A command-line argument that contains <b>${mailbox}</b> expands
to as many command-line arguments as there are recipi- to as many command-line arguments as there are recipi-
ents. ents.
This information is modified by the <b>u</b> flag for case fold- This information is modified by the <b>u</b> flag for case fold-
@@ -265,11 +270,11 @@ PIPE(8) PIPE(8)
ing. ing.
<b>${original_recipient}</b> <b>${original_recipient}</b>
This macro expands to the complete recipient address This macro expands to the complete recipient address
before any address rewriting or aliasing. before any address rewriting or aliasing.
A command-line argument that contains <b>${original_recipi-</b> A command-line argument that contains <b>${original_recipi-</b>
<b>ent}</b> expands to as many command-line arguments as there <b>ent}</b> expands to as many command-line arguments as there
are recipients. are recipients.
This information is modified by the <b>hqu</b> flags for quoting This information is modified by the <b>hqu</b> flags for quoting
@@ -285,8 +290,8 @@ PIPE(8) PIPE(8)
<b>${recipient}</b> <b>${recipient}</b>
This macro expands to the complete recipient address. This macro expands to the complete recipient address.
A command-line argument that contains <b>${recipient}</b> A command-line argument that contains <b>${recipient}</b>
expands to as many command-line arguments as there are expands to as many command-line arguments as there are
recipients. recipients.
This information is modified by the <b>hqu</b> flags for quoting This information is modified by the <b>hqu</b> flags for quoting
@@ -294,13 +299,13 @@ PIPE(8) PIPE(8)
<b>${sasl_method}</b> <b>${sasl_method}</b>
This macro expands to the name of the SASL authentication This macro expands to the name of the SASL authentication
mechanism in the AUTH command when the Postfix SMTP mechanism in the AUTH command when the Postfix SMTP
server received the message. server received the message.
This feature is available as of Postfix 2.2. This feature is available as of Postfix 2.2.
<b>${sasl_sender}</b> <b>${sasl_sender}</b>
This macro expands to the SASL sender name (i.e. the This macro expands to the SASL sender name (i.e. the
original submitter as per <a href="http://tools.ietf.org/html/rfc4954">RFC 4954</a>) in the MAIL FROM com- original submitter as per <a href="http://tools.ietf.org/html/rfc4954">RFC 4954</a>) in the MAIL FROM com-
mand when the Postfix SMTP server received the message. mand when the Postfix SMTP server received the message.
@@ -313,25 +318,25 @@ PIPE(8) PIPE(8)
This feature is available as of Postfix 2.2. This feature is available as of Postfix 2.2.
<b>${sender}</b> <b>${sender}</b>
This macro expands to the envelope sender address. By This macro expands to the envelope sender address. By
default, the null sender address expands to MAILER-DAE- default, the null sender address expands to MAILER-DAE-
MON; this can be changed with the <b>null_sender</b> attribute, MON; this can be changed with the <b>null_sender</b> attribute,
as described above. as described above.
This information is modified by the <b>q</b> flag for quoting. This information is modified by the <b>q</b> flag for quoting.
<b>${size}</b> <b>${size}</b>
This macro expands to Postfix's idea of the message size, This macro expands to Postfix's idea of the message size,
which is an approximation of the size of the message as which is an approximation of the size of the message as
delivered. delivered.
<b>${user}</b> <b>${user}</b>
This macro expands to the username part of a recipient This macro expands to the username part of a recipient
address. For example, with an address <i>user+foo@domain</i> address. For example, with an address <i>user+foo@domain</i>
the username part is <i>user</i>. the username part is <i>user</i>.
A command-line argument that contains <b>${user}</b> expands A command-line argument that contains <b>${user}</b> expands
into as many command-line arguments as there are recipi- into as many command-line arguments as there are recipi-
ents. ents.
This information is modified by the <b>u</b> flag for case fold- This information is modified by the <b>u</b> flag for case fold-
@@ -341,36 +346,36 @@ PIPE(8) PIPE(8)
<a href="http://tools.ietf.org/html/rfc3463">RFC 3463</a> (Enhanced status codes) <a href="http://tools.ietf.org/html/rfc3463">RFC 3463</a> (Enhanced status codes)
<b>DIAGNOSTICS</b> <b>DIAGNOSTICS</b>
Command exit status codes are expected to follow the conventions Command exit status codes are expected to follow the conventions
defined in &lt;<b>sysexits.h</b>&gt;. Exit status 0 means normal successful comple- defined in &lt;<b>sysexits.h</b>&gt;. Exit status 0 means normal successful comple-
tion. tion.
In the case of a non-zero exit status, a limited amount of command out- In the case of a non-zero exit status, a limited amount of command out-
put is logged, and reported in a delivery status notification. When put is logged, and reported in a delivery status notification. When
the output begins with a 4.X.X or 5.X.X enhanced status code, the sta- the output begins with a 4.X.X or 5.X.X enhanced status code, the sta-
tus code takes precedence over the non-zero exit status (Postfix ver- tus code takes precedence over the non-zero exit status (Postfix ver-
sion 2.3 and later). sion 2.3 and later).
After successful delivery (zero exit status) a limited amount of com- After successful delivery (zero exit status) a limited amount of com-
mand output is logged, and reported in "success" delivery status noti- mand output is logged, and reported in "success" delivery status noti-
fications (Postfix 2.12 and later). This command output is not exam- fications (Postfix 2.12 and later). This command output is not exam-
ined for the presence of an enhanced status code. ined for the presence of an enhanced status code.
Problems and transactions are logged to <b>syslogd</b>(8). Corrupted message Problems and transactions are logged to <b>syslogd</b>(8). Corrupted message
files are marked so that the queue manager can move them to the <b>corrupt</b> files are marked so that the queue manager can move them to the <b>corrupt</b>
queue for further inspection. queue for further inspection.
<b>SECURITY</b> <b>SECURITY</b>
This program needs a dual personality 1) to access the private Postfix This program needs a dual personality 1) to access the private Postfix
queue and IPC mechanisms, and 2) to execute external commands as the queue and IPC mechanisms, and 2) to execute external commands as the
specified user. It is therefore security sensitive. specified user. It is therefore security sensitive.
<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="pipe.8.html"><b>pipe</b>(8)</a> processes run Changes to <a href="postconf.5.html"><b>main.cf</b></a> are picked up automatically as <a href="pipe.8.html"><b>pipe</b>(8)</a> processes run
for only a limited amount of time. Use the command "<b>postfix reload</b>" to for only a limited amount of time. Use the command "<b>postfix reload</b>" to
speed up a change. 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.
<b>RESOURCE AND RATE CONTROLS</b> <b>RESOURCE AND RATE CONTROLS</b>
@@ -379,51 +384,51 @@ PIPE(8) PIPE(8)
<b><a href="postconf.5.html#transport_destination_concurrency_limit"><i>transport</i>_destination_concurrency_limit</a> ($<a href="postconf.5.html#default_destination_concurrency_limit">default_destination_concur</a>-</b> <b><a href="postconf.5.html#transport_destination_concurrency_limit"><i>transport</i>_destination_concurrency_limit</a> ($<a href="postconf.5.html#default_destination_concurrency_limit">default_destination_concur</a>-</b>
<b><a href="postconf.5.html#default_destination_concurrency_limit">rency_limit</a>)</b> <b><a href="postconf.5.html#default_destination_concurrency_limit">rency_limit</a>)</b>
Limit the number of parallel deliveries to the same destination, Limit the number of parallel deliveries to the same destination,
for delivery via the named <i>transport</i>. The limit is enforced by for delivery via the named <i>transport</i>. The limit is enforced by
the Postfix queue manager. the Postfix queue manager.
<b><a href="postconf.5.html#transport_destination_recipient_limit"><i>transport</i>_destination_recipient_limit</a> ($<a href="postconf.5.html#default_destination_recipient_limit">default_destination_recipi</a>-</b> <b><a href="postconf.5.html#transport_destination_recipient_limit"><i>transport</i>_destination_recipient_limit</a> ($<a href="postconf.5.html#default_destination_recipient_limit">default_destination_recipi</a>-</b>
<b><a href="postconf.5.html#default_destination_recipient_limit">ent_limit</a>)</b> <b><a href="postconf.5.html#default_destination_recipient_limit">ent_limit</a>)</b>
Limit the number of recipients per message delivery, for deliv- Limit the number of recipients per message delivery, for deliv-
ery via the named <i>transport</i>. The limit is enforced by the Post- ery via the named <i>transport</i>. The limit is enforced by the Post-
fix queue manager. fix queue manager.
<b><a href="postconf.5.html#transport_time_limit"><i>transport</i>_time_limit</a> ($<a href="postconf.5.html#command_time_limit">command_time_limit</a>)</b> <b><a href="postconf.5.html#transport_time_limit"><i>transport</i>_time_limit</a> ($<a href="postconf.5.html#command_time_limit">command_time_limit</a>)</b>
Limit the time for delivery to external command, for delivery Limit the time for delivery to external command, for delivery
via the named <i>transport</i>. The limit is enforced by the pipe via the named <i>transport</i>. The limit is enforced by the pipe
delivery agent. delivery agent.
Postfix 2.4 and later support a suffix that specifies the time Postfix 2.4 and later support a suffix that specifies the time
unit: s (seconds), m (minutes), h (hours), d (days), w (weeks). unit: s (seconds), m (minutes), h (hours), d (days), w (weeks).
The default time unit is seconds. The default time unit is seconds.
<b>MISCELLANEOUS CONTROLS</b> <b>MISCELLANEOUS CONTROLS</b>
<b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b> <b><a href="postconf.5.html#config_directory">config_directory</a> (see 'postconf -d' output)</b>
The default location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con- The default location of the Postfix <a href="postconf.5.html">main.cf</a> and <a href="master.5.html">master.cf</a> con-
figuration files. figuration files.
<b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b> <b><a href="postconf.5.html#daemon_timeout">daemon_timeout</a> (18000s)</b>
How much time a Postfix daemon process may take to handle a How much time a Postfix daemon process may take to handle a
request before it is terminated by a built-in watchdog timer. request before it is terminated by a built-in watchdog timer.
<b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b> <b><a href="postconf.5.html#delay_logging_resolution_limit">delay_logging_resolution_limit</a> (2)</b>
The maximal number of digits after the decimal point when log- The maximal number of digits after the decimal point when log-
ging sub-second delay values. ging sub-second delay values.
<b><a href="postconf.5.html#export_environment">export_environment</a> (see 'postconf -d' output)</b> <b><a href="postconf.5.html#export_environment">export_environment</a> (see 'postconf -d' output)</b>
The list of environment variables that a Postfix process will The list of environment variables that a Postfix process will
export to non-Postfix processes. export to non-Postfix processes.
<b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b> <b><a href="postconf.5.html#ipc_timeout">ipc_timeout</a> (3600s)</b>
The time limit for sending or receiving information over an The time limit for sending or receiving information over an
internal communication channel. internal communication channel.
<b><a href="postconf.5.html#mail_owner">mail_owner</a> (postfix)</b> <b><a href="postconf.5.html#mail_owner">mail_owner</a> (postfix)</b>
The UNIX system account that owns the Postfix queue and most The UNIX system account that owns the Postfix queue and most
Postfix daemon processes. Postfix daemon processes.
<b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b> <b><a href="postconf.5.html#max_idle">max_idle</a> (100s)</b>
The maximum amount of time that an idle Postfix daemon process The maximum amount of time that an idle Postfix daemon process
waits for an incoming connection before terminating voluntarily. waits for an incoming connection before terminating voluntarily.
<b><a href="postconf.5.html#max_use">max_use</a> (100)</b> <b><a href="postconf.5.html#max_use">max_use</a> (100)</b>
@@ -440,22 +445,22 @@ PIPE(8) PIPE(8)
The location of the Postfix top-level queue directory. The location of the Postfix top-level queue directory.
<b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b> <b><a href="postconf.5.html#recipient_delimiter">recipient_delimiter</a> (empty)</b>
The set of characters that can separate a user name from its The set of characters that can separate a user name from its
extension (example: user+foo), or a .forward file name from its extension (example: user+foo), or a .forward file name from its
extension (example: .forward+foo). extension (example: .forward+foo).
<b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b> <b><a href="postconf.5.html#syslog_facility">syslog_facility</a> (mail)</b>
The syslog facility of Postfix logging. The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b> <b><a href="postconf.5.html#syslog_name">syslog_name</a> (see 'postconf -d' output)</b>
The mail system name that is prepended to the process name in The mail system name that is prepended to the process name in
syslog records, so that "smtpd" becomes, for example, "post- syslog records, so that "smtpd" becomes, for example, "post-
fix/smtpd". fix/smtpd".
Available in Postfix version 2.12 and later: Available in Postfix version 2.12 and later:
<b><a href="postconf.5.html#pipe_delivery_status_filter">pipe_delivery_status_filter</a> ($<a href="postconf.5.html#default_delivery_status_filter">default_delivery_status_filter</a>)</b> <b><a href="postconf.5.html#pipe_delivery_status_filter">pipe_delivery_status_filter</a> ($<a href="postconf.5.html#default_delivery_status_filter">default_delivery_status_filter</a>)</b>
Optional filter for the <a href="pipe.8.html"><b>pipe</b>(8)</a> delivery agent to change the Optional filter for the <a href="pipe.8.html"><b>pipe</b>(8)</a> delivery agent to change the
delivery status code or explanatory text of successful or unsuc- delivery status code or explanatory text of successful or unsuc-
cessful deliveries. cessful deliveries.

View File

@@ -165,7 +165,8 @@ changed.
The command to be executed. Characters that are special The command to be executed. Characters that are special
to the shell such as ">" or "|" have no special meaning to the shell such as ">" or "|" have no special meaning
here, and quotes cannot be used to protect arguments here, and quotes cannot be used to protect arguments
containing whitespace. containing whitespace. To protect whitespace, use "{"
and "}" as described below.
.sp .sp
The command name is relative to the Postfix daemon directory The command name is relative to the Postfix daemon directory
(pathname is controlled by the \fBdaemon_directory\fR (pathname is controlled by the \fBdaemon_directory\fR
@@ -181,13 +182,15 @@ all daemon programs:
Run the daemon under control by the command specified with Run the daemon under control by the command specified with
the \fBdebugger_command\fR variable in the main.cf the \fBdebugger_command\fR variable in the main.cf
configuration file. See DEBUG_README for hints and tips. configuration file. See DEBUG_README for hints and tips.
.IP "\fB-o \fIname\fR=\fIvalue\fR" .IP "\fB-o \fIname\fR=\fIvalue\fR (short form)"
.IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (Postfix 2.12 and later)"
Override the named main.cf configuration parameter. The Override the named main.cf configuration parameter. The
parameter value can refer to other parameters as \fI$name\fR parameter value can refer to other parameters as \fI$name\fR
etc., just like in main.cf. See \fBpostconf\fR(5) for etc., just like in main.cf. See \fBpostconf\fR(5) for
syntax. syntax.
.sp .sp
NOTE 1: do not specify whitespace around the "=" or in NOTE 1: with the "short form" shown above, do not specify
whitespace around the "=" or in
parameter values. To specify a parameter value that contains parameter values. To specify a parameter value that contains
whitespace, use commas instead of spaces, or specify the whitespace, use commas instead of spaces, or specify the
value in main.cf. Example: value in main.cf. Example:
@@ -209,6 +212,10 @@ personalities via master.cf.
.IP \fB-v\fR .IP \fB-v\fR
Increase the verbose logging level. Specify multiple \fB-v\fR Increase the verbose logging level. Specify multiple \fB-v\fR
options to make a Postfix daemon process increasingly verbose. options to make a Postfix daemon process increasingly verbose.
.IP "Other command-line arguments"
Specify "{" and "}" around command arguments that contain
whitespace (Postfix 2.12 and later). Whitespace immediately
after "{" and before "}" is ignored.
.SH "SEE ALSO" .SH "SEE ALSO"
.na .na
.nf .nf

View File

@@ -199,13 +199,17 @@ last command attribute.
The command is executed directly, i.e. without interpretation of The command is executed directly, i.e. without interpretation of
shell meta characters by a shell command interpreter. shell meta characters by a shell command interpreter.
.sp .sp
Specify "{" and "}" around command arguments that contain
whitespace (Postfix 2.12 and later). Whitespace immediately
after "{" and before "}" is ignored.
.sp
In the command argument vector, the following macros are recognized In the command argument vector, the following macros are recognized
and replaced with corresponding information from the Postfix queue and replaced with corresponding information from the Postfix queue
manager delivery request. manager delivery request.
.sp .sp
In addition to the form ${\fIname\fR}, the forms $\fIname\fR and In addition to the form ${\fIname\fR}, the forms $\fIname\fR and
$(\fIname\fR) are also recognized. Specify \fB$$\fR where a single the deprecated form $(\fIname\fR) are also recognized.
\fB$\fR is wanted. Specify \fB$$\fR where a single \fB$\fR is wanted.
.RS .RS
.IP \fB${client_address}\fR .IP \fB${client_address}\fR
This macro expands to the remote client network address. This macro expands to the remote client network address.

View File

@@ -75,9 +75,9 @@ verification probes</a>
<h2><a name="how">How address verification works</a></h2> <h2><a name="how">How address verification works</a></h2>
<p> A Postfix MTA verifies a sender or recipient address by probing <p> A Postfix MTA verifies a sender or recipient address by probing
the nearest the preferred MTAs
MTA for that address, without actually delivering mail. The nearest for that address, without actually delivering mail. The preferred
MTA could be the Postfix MTA itself, or it could be a remote MTA MTAs could include the Postfix MTA itself, or some remote MTAs
(SMTP (SMTP
interruptus). Probe messages are like normal mail, except that interruptus). Probe messages are like normal mail, except that
they are never delivered, deferred or bounced; probe messages are they are never delivered, deferred or bounced; probe messages are
@@ -198,12 +198,12 @@ details. </p>
<ul> <ul>
<li> <p> When verifying a remote address, Postfix probes the nearest <li> <p> When verifying a remote address, Postfix probes the preferred
MTA for that address, without actually delivering mail to it. If MTAs for that address, without actually delivering mail. If
the nearest MTA accepts the address, then Postfix assumes that the a preferred MTA accepts the address, then Postfix assumes that the
address is deliverable. In reality, mail for a remote address can address is deliverable. In reality, mail for a remote address can
bounce AFTER the nearest MTA accepts the recipient address, or AFTER bounce AFTER a preferred MTA accepts the recipient address, or AFTER
the nearest MTA accepts the message content. </p> a preferred MTA accepts the message content. </p>
<li> <p> Some sites may blacklist you when you are probing them <li> <p> Some sites may blacklist you when you are probing them
too often (a probe is an SMTP session that does not deliver mail), too often (a probe is an SMTP session that does not deliver mail),
@@ -219,10 +219,10 @@ the routing of address verification probes"</a>, for how to override
mail routing and for possible limitations when you have to do this. mail routing and for possible limitations when you have to do this.
</p> </p>
<li> <p> Postfix assumes that an address is undeliverable when the <li> <p> Postfix assumes that an address is undeliverable when a
nearest MTA for the address rejects the probe, regardless of the preferred MTA for the address rejects the probe, regardless of the
reason for rejection (client rejected, HELO rejected, MAIL FROM reason for rejection (client rejected, HELO rejected, MAIL FROM
rejected, etc.). Thus, Postfix rejects an address when the nearest rejected, etc.). Thus, Postfix rejects an address when a preferred
MTA for that address rejects mail from your machine for any reason. MTA for that address rejects mail from your machine for any reason.
This is not a limitation, but it is mentioned here just in case This is not a limitation, but it is mentioned here just in case
people believe that it is a limitation. </p> people believe that it is a limitation. </p>

View File

@@ -159,7 +159,8 @@
# The command to be executed. Characters that are special # The command to be executed. Characters that are special
# to the shell such as ">" or "|" have no special meaning # to the shell such as ">" or "|" have no special meaning
# here, and quotes cannot be used to protect arguments # here, and quotes cannot be used to protect arguments
# containing whitespace. # containing whitespace. To protect whitespace, use "{"
# and "}" as described below.
# .sp # .sp
# The command name is relative to the Postfix daemon directory # The command name is relative to the Postfix daemon directory
# (pathname is controlled by the \fBdaemon_directory\fR # (pathname is controlled by the \fBdaemon_directory\fR
@@ -175,13 +176,15 @@
# Run the daemon under control by the command specified with # Run the daemon under control by the command specified with
# the \fBdebugger_command\fR variable in the main.cf # the \fBdebugger_command\fR variable in the main.cf
# configuration file. See DEBUG_README for hints and tips. # configuration file. See DEBUG_README for hints and tips.
# .IP "\fB-o \fIname\fR=\fIvalue\fR" # .IP "\fB-o \fIname\fR=\fIvalue\fR (short form)"
# .IP "\fB-o { \fIname\fR = \fIvalue\fB }\fR (Postfix 2.12 and later)"
# Override the named main.cf configuration parameter. The # Override the named main.cf configuration parameter. The
# parameter value can refer to other parameters as \fI$name\fR # parameter value can refer to other parameters as \fI$name\fR
# etc., just like in main.cf. See \fBpostconf\fR(5) for # etc., just like in main.cf. See \fBpostconf\fR(5) for
# syntax. # syntax.
# .sp # .sp
# NOTE 1: do not specify whitespace around the "=" or in # NOTE 1: with the "short form" shown above, do not specify
# whitespace around the "=" or in
# parameter values. To specify a parameter value that contains # parameter values. To specify a parameter value that contains
# whitespace, use commas instead of spaces, or specify the # whitespace, use commas instead of spaces, or specify the
# value in main.cf. Example: # value in main.cf. Example:
@@ -203,6 +206,10 @@
# .IP \fB-v\fR # .IP \fB-v\fR
# Increase the verbose logging level. Specify multiple \fB-v\fR # Increase the verbose logging level. Specify multiple \fB-v\fR
# options to make a Postfix daemon process increasingly verbose. # options to make a Postfix daemon process increasingly verbose.
# .IP "Other command-line arguments"
# Specify "{" and "}" around command arguments that contain
# whitespace (Postfix 2.12 and later). Whitespace immediately
# after "{" and before "}" is ignored.
# SEE ALSO # SEE ALSO
# master(8), process manager # master(8), process manager
# postconf(5), configuration parameters # postconf(5), configuration parameters

View File

@@ -28,32 +28,23 @@
/* See mystrtok(3) for description. Typical values are /* See mystrtok(3) for description. Typical values are
/* ", \\t\\r\\n" and "{}", respectively. /* ", \\t\\r\\n" and "{}", respectively.
/* .PP /* .PP
/* The parens argument is followed by a list of (key, value, /* The parens argument is followed by a list of (key, value)
/* value) argument triples. Each key may appear only once. /* argument pairs. Each key may appear only once. The list
/* The list must be terminated with ATTR_OVER_END. The following /* must be terminated with ATTR_OVER_END. The following
/* describes the keys and the expected values. /* describes the keys and the expected values.
/* .IP "ATTR_OVER_STR_TABLE, const ATTR_OVER_STR *, CONST_CHAR_STAR *" /* .IP "ATTR_OVER_STR_TABLE, const ATTR_OVER_STR *
/* The second argument specifies a null-terminated table with /* The second argument specifies a null-terminated table with
/* attribute names and their range limits which should be the /* attribute names, assignment targets, and range limits which
/* same as for the corresponding main.cf parameters. The /* should be the same as for the corresponding main.cf parameters.
/* third argument specifies a parallel table with assignment /* .IP "ATTR_OVER_TIME_TABLE, const ATTR_OVER_TIME *
/* targets. The result strings are NOT copied.
/* .IP "ATTR_OVER_TIME_TABLE, const ATTR_OVER_TIME *, int *"
/* The second argument specifies a null-terminated table with /* The second argument specifies a null-terminated table with
/* attribute names, their default time units (leading digits /* attribute names, their default time units (leading digits
/* are skipped), and their range limits which should be the /* are skipped), assignment targets, and range limits which
/* same as for the corresponding main.cf parameters. The /* should be the same as for the corresponding main.cf parameters.
/* third argument specifies a parallel table with assignment /* .IP "ATTR_OVER_INT_TABLE, const ATTR_OVER_INT *
/* targets.
/* .IP "ATTR_OVER_INT_TABLE, const ATTR_OVER_INT *, int *"
/* The second argument specifies a null-terminated table with /* The second argument specifies a null-terminated table with
/* attribute names and their range limits which should be the /* attribute names, assignment targets, and range limits which
/* same as for the corresponding main.cf parameters. The /* should be the same as for the corresponding main.cf parameters.
/* third argument specifies a parallel table with assignment
/* targets.
/* BUGS
/* Parallel tables may be inelegant, but the alternative (static
/* allocation of target variables) is worse.
/* SEE ALSO /* SEE ALSO
/* mystrtok(3), safe tokenizer /* mystrtok(3), safe tokenizer
/* extpar(3), extract text from parentheses /* extpar(3), extract text from parentheses
@@ -106,9 +97,6 @@ void attr_override(char *cp, const char *sep, const char *parens,...)
const ATTR_OVER_INT *int_table = 0; const ATTR_OVER_INT *int_table = 0;
const ATTR_OVER_STR *str_table = 0; const ATTR_OVER_STR *str_table = 0;
const ATTR_OVER_TIME *time_table = 0; const ATTR_OVER_TIME *time_table = 0;
int *int_tgts = 0;
CONST_CHAR_STAR *str_tgts = 0;
int *time_tgts = 0;
/* /*
* Get the lookup tables and assignment targets. * Get the lookup tables and assignment targets.
@@ -120,19 +108,16 @@ void attr_override(char *cp, const char *sep, const char *parens,...)
if (int_table) if (int_table)
msg_panic("%s: multiple ATTR_OVER_INT_TABLE", myname); msg_panic("%s: multiple ATTR_OVER_INT_TABLE", myname);
int_table = va_arg(ap, const ATTR_OVER_INT *); int_table = va_arg(ap, const ATTR_OVER_INT *);
int_tgts = va_arg(ap, int *);
break; break;
case ATTR_OVER_STR_TABLE: case ATTR_OVER_STR_TABLE:
if (str_table) if (str_table)
msg_panic("%s: multiple ATTR_OVER_STR_TABLE", myname); msg_panic("%s: multiple ATTR_OVER_STR_TABLE", myname);
str_table = va_arg(ap, const ATTR_OVER_STR *); str_table = va_arg(ap, const ATTR_OVER_STR *);
str_tgts = va_arg(ap, CONST_CHAR_STAR *);
break; break;
case ATTR_OVER_TIME_TABLE: case ATTR_OVER_TIME_TABLE:
if (time_table) if (time_table)
msg_panic("%s: multiple ATTR_OVER_TIME_TABLE", myname); msg_panic("%s: multiple ATTR_OVER_TIME_TABLE", myname);
time_table = va_arg(ap, const ATTR_OVER_TIME *); time_table = va_arg(ap, const ATTR_OVER_TIME *);
time_tgts = va_arg(ap, int *);
break; break;
default: default:
msg_panic("%s: unknown argument type: %d", myname, idx); msg_panic("%s: unknown argument type: %d", myname, idx);
@@ -173,7 +158,7 @@ void attr_override(char *cp, const char *sep, const char *parens,...)
if (strcmp(sp->name, key) != 0) if (strcmp(sp->name, key) != 0)
continue; continue;
check_mail_conf_str(sp->name, value, sp->min, sp->max); check_mail_conf_str(sp->name, value, sp->min, sp->max);
str_tgts[sp - str_table] = value; sp->target[0] = value;
found = 1; found = 1;
} }
for (ip = int_table; ip != 0 && found == 0 && ip->name != 0; ip++) { for (ip = int_table; ip != 0 && found == 0 && ip->name != 0; ip++) {
@@ -186,7 +171,7 @@ void attr_override(char *cp, const char *sep, const char *parens,...)
|| longval != int_val) || longval != int_val)
msg_fatal("bad numerical configuration: %s = %s", key, value); msg_fatal("bad numerical configuration: %s = %s", key, value);
check_mail_conf_int(key, int_val, ip->min, ip->max); check_mail_conf_int(key, int_val, ip->min, ip->max);
int_tgts[ip - int_table] = int_val; ip->target[0] = int_val;
found = 1; found = 1;
} }
for (tp = time_table; tp != 0 && found == 0 && tp->name != 0; tp++) { for (tp = time_table; tp != 0 && found == 0 && tp->name != 0; tp++) {
@@ -196,7 +181,7 @@ void attr_override(char *cp, const char *sep, const char *parens,...)
if (conv_time(value, &int_val, def_unit) == 0) if (conv_time(value, &int_val, def_unit) == 0)
msg_fatal("%s: bad time value or unit: %s", key, value); msg_fatal("%s: bad time value or unit: %s", key, value);
check_mail_conf_time(key, int_val, tp->min, tp->max); check_mail_conf_time(key, int_val, tp->min, tp->max);
time_tgts[tp - time_table] = int_val; tp->target[0] = int_val;
found = 1; found = 1;
} }
if (found == 0) if (found == 0)

View File

@@ -20,6 +20,7 @@ typedef const char *CONST_CHAR_STAR;
typedef struct { typedef struct {
const char *name; const char *name;
CONST_CHAR_STAR *target;
int min; int min;
int max; int max;
} ATTR_OVER_STR; } ATTR_OVER_STR;
@@ -27,12 +28,14 @@ typedef struct {
typedef struct { typedef struct {
const char *name; const char *name;
const char *defval; const char *defval;
int *target;
int min; int min;
int max; int max;
} ATTR_OVER_TIME; } ATTR_OVER_TIME;
typedef struct { typedef struct {
const char *name; const char *name;
int *target;
int min; int min;
int max; int max;
} ATTR_OVER_INT; } ATTR_OVER_INT;

View File

@@ -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 "20140928" #define MAIL_RELEASE_DATE "20140929"
#define MAIL_VERSION_NUMBER "2.12" #define MAIL_VERSION_NUMBER "2.12"
#ifdef SNAPSHOT #ifdef SNAPSHOT

View File

@@ -538,28 +538,28 @@ void milter_disc_event(MILTERS *milters)
* Table-driven parsing of main.cf parameter overrides for specific Milters. * Table-driven parsing of main.cf parameter overrides for specific Milters.
* We derive the override names from the corresponding main.cf parameter * We derive the override names from the corresponding main.cf parameter
* names by skipping the redundant "milter_" prefix. * names by skipping the redundant "milter_" prefix.
*
* To avoid ugly static allocation of assignment targets, we use stack-based
* parallel arrays which is less inelegant.
*/ */
static const ATTR_OVER_TIME time_table[] = { static ATTR_OVER_TIME time_table[] = {
7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 1, 0, 7 + VAR_MILT_CONN_TIME, DEF_MILT_CONN_TIME, 0, 1, 0,
7 + VAR_MILT_CMD_TIME, DEF_MILT_CMD_TIME, 1, 0, 7 + VAR_MILT_CMD_TIME, DEF_MILT_CMD_TIME, 0, 1, 0,
7 + VAR_MILT_MSG_TIME, DEF_MILT_MSG_TIME, 1, 0, 7 + VAR_MILT_MSG_TIME, DEF_MILT_MSG_TIME, 0, 1, 0,
0, 0,
}; };
static const ATTR_OVER_STR str_table[] = { static ATTR_OVER_STR str_table[] = {
7 + VAR_MILT_PROTOCOL, 1, 0, 7 + VAR_MILT_PROTOCOL, 0, 1, 0,
7 + VAR_MILT_DEF_ACTION, 1, 0, 7 + VAR_MILT_DEF_ACTION, 0, 1, 0,
0, 0,
}; };
#define conn_timeout_override time_tgts[0] #define link_override_table_to_variable(table, var) \
#define cmd_timeout_override time_tgts[1] do { table[var##_offset].target = &var; } while (0)
#define msg_timeout_override time_tgts[2]
#define protocol_override str_tgts[0] #define my_conn_timeout_offset 0
#define action_override str_tgts[1] #define my_cmd_timeout_offset 1
#define my_msg_timeout_offset 2
#define my_protocol_offset 0
#define my_def_action_offset 1
/* milter_new - create milter list */ /* milter_new - create milter list */
@@ -578,8 +578,20 @@ MILTERS *milter_new(const char *names,
MILTER *milter; MILTER *milter;
const char *sep = ", \t\r\n"; const char *sep = ", \t\r\n";
const char *parens = "{}"; const char *parens = "{}";
int time_tgts[sizeof(time_table) / sizeof(time_table[0])]; int my_conn_timeout;
const char *str_tgts[sizeof(str_table) / sizeof(str_table[0])]; int my_cmd_timeout;
int my_msg_timeout;
const char *my_protocol;
const char *my_def_action;
/*
* Initialize.
*/
link_override_table_to_variable(time_table, my_conn_timeout);
link_override_table_to_variable(time_table, my_cmd_timeout);
link_override_table_to_variable(time_table, my_msg_timeout);
link_override_table_to_variable(str_table, my_protocol);
link_override_table_to_variable(str_table, my_def_action);
/* /*
* Parse the milter list. * Parse the milter list.
@@ -588,7 +600,6 @@ MILTERS *milter_new(const char *names,
if (names != 0 && *names != 0) { if (names != 0 && *names != 0) {
char *saved_names = mystrdup(names); char *saved_names = mystrdup(names);
char *cp = saved_names; char *cp = saved_names;
char *name_override;
char *op; char *op;
char *err; char *err;
@@ -596,34 +607,25 @@ MILTERS *milter_new(const char *names,
* Instantiate Milters, allowing for per-Milter overrides. * Instantiate Milters, allowing for per-Milter overrides.
*/ */
while ((name = mystrtokq(&cp, sep, parens)) != 0) { while ((name = mystrtokq(&cp, sep, parens)) != 0) {
my_conn_timeout = conn_timeout;
my_cmd_timeout = cmd_timeout;
my_msg_timeout = msg_timeout;
my_protocol = protocol;
my_def_action = def_action;
if (name[0] == '{') { /* } */ if (name[0] == '{') { /* } */
op = name; op = name;
if ((err = extpar(&op, parens, EXPAR_FLAG_NONE)) != 0) if ((err = extpar(&op, parens, EXPAR_FLAG_NONE)) != 0)
msg_fatal("milter service syntax error: %s", err); msg_fatal("milter service syntax error: %s", err);
if ((name_override = mystrtok(&op, sep)) == 0) { if ((name = mystrtok(&op, sep)) == 0)
msg_fatal("empty milter definition: \"%s\"", name); msg_fatal("empty milter definition: \"%s\"", names);
} else { attr_override(op, sep, parens,
conn_timeout_override = conn_timeout; ATTR_OVER_STR_TABLE, str_table,
cmd_timeout_override = cmd_timeout; ATTR_OVER_TIME_TABLE, time_table,
msg_timeout_override = msg_timeout; 0);
protocol_override = protocol;
action_override = def_action;
attr_override(op, sep, parens,
ATTR_OVER_STR_TABLE, str_table, str_tgts,
ATTR_OVER_TIME_TABLE, time_table, time_tgts,
0);
milter = milter8_create(name_override,
conn_timeout_override,
cmd_timeout_override,
msg_timeout_override,
protocol_override,
action_override, milters);
}
} else {
milter = milter8_create(name, conn_timeout, cmd_timeout,
msg_timeout, protocol, def_action,
milters);
} }
milter = milter8_create(name, my_conn_timeout, my_cmd_timeout,
my_msg_timeout, my_protocol,
my_def_action, milters);
if (head == 0) { if (head == 0) {
head = milter; head = milter;
} else { } else {

View File

@@ -189,13 +189,17 @@
/* The command is executed directly, i.e. without interpretation of /* The command is executed directly, i.e. without interpretation of
/* shell meta characters by a shell command interpreter. /* shell meta characters by a shell command interpreter.
/* .sp /* .sp
/* Specify "{" and "}" around command arguments that contain
/* whitespace (Postfix 2.12 and later). Whitespace immediately
/* after "{" and before "}" is ignored.
/* .sp
/* In the command argument vector, the following macros are recognized /* In the command argument vector, the following macros are recognized
/* and replaced with corresponding information from the Postfix queue /* and replaced with corresponding information from the Postfix queue
/* manager delivery request. /* manager delivery request.
/* .sp /* .sp
/* In addition to the form ${\fIname\fR}, the forms $\fIname\fR and /* In addition to the form ${\fIname\fR}, the forms $\fIname\fR and
/* $(\fIname\fR) are also recognized. Specify \fB$$\fR where a single /* the deprecated form $(\fIname\fR) are also recognized.
/* \fB$\fR is wanted. /* Specify \fB$$\fR where a single \fB$\fR is wanted.
/* .RS /* .RS
/* .IP \fB${client_address}\fR /* .IP \fB${client_address}\fR
/* This macro expands to the remote client network address. /* This macro expands to the remote client network address.

View File

@@ -468,36 +468,36 @@ typedef struct {
* Table-driven parsing of main.cf parameter overrides for specific policy * Table-driven parsing of main.cf parameter overrides for specific policy
* clients. We derive the override names from the corresponding main.cf * clients. We derive the override names from the corresponding main.cf
* parameter names by skipping the redundant "smtpd_policy_service_" prefix. * parameter names by skipping the redundant "smtpd_policy_service_" prefix.
*
* To avoid ugly static allocation of assignment targets, we use stack-based
* parallel arrays which is less inelegant.
*/ */
static const ATTR_OVER_TIME time_table[] = { static ATTR_OVER_TIME time_table[] = {
21 + VAR_SMTPD_POLICY_TMOUT, DEF_SMTPD_POLICY_TMOUT, 1, 0, 21 + VAR_SMTPD_POLICY_TMOUT, DEF_SMTPD_POLICY_TMOUT, 0, 1, 0,
21 + VAR_SMTPD_POLICY_IDLE, DEF_SMTPD_POLICY_IDLE, 1, 0, 21 + VAR_SMTPD_POLICY_IDLE, DEF_SMTPD_POLICY_IDLE, 0, 1, 0,
21 + VAR_SMTPD_POLICY_TTL, DEF_SMTPD_POLICY_TTL, 1, 0, 21 + VAR_SMTPD_POLICY_TTL, DEF_SMTPD_POLICY_TTL, 0, 1, 0,
21 + VAR_SMTPD_POLICY_TRY_DELAY, DEF_SMTPD_POLICY_TRY_DELAY, 1, 0, 21 + VAR_SMTPD_POLICY_TRY_DELAY, DEF_SMTPD_POLICY_TRY_DELAY, 0, 1, 0,
0, 0,
}; };
static const ATTR_OVER_INT int_table[] = { static ATTR_OVER_INT int_table[] = {
21 + VAR_SMTPD_POLICY_REQ_LIMIT, 0, 0, 21 + VAR_SMTPD_POLICY_REQ_LIMIT, 0, 0, 0,
21 + VAR_SMTPD_POLICY_TRY_LIMIT, 1, 0, 21 + VAR_SMTPD_POLICY_TRY_LIMIT, 0, 1, 0,
0, 0,
}; };
static const ATTR_OVER_STR str_table[] = { static ATTR_OVER_STR str_table[] = {
21 + VAR_SMTPD_POLICY_DEF_ACTION, 1, 0, 21 + VAR_SMTPD_POLICY_DEF_ACTION, 0, 1, 0,
0, 0,
}; };
#define smtpd_policy_tmout time_tgts[0] #define link_override_table_to_variable(table, var) \
#define smtpd_policy_idle time_tgts[1] do { table[var##_offset].target = &var; } while (0)
#define smtpd_policy_ttl time_tgts[2]
#define smtpd_policy_try_delay time_tgts[3]
#define smtpd_policy_req_limit int_tgts[0] #define smtpd_policy_tmout_offset 0
#define smtpd_policy_try_limit int_tgts[1] #define smtpd_policy_idle_offset 1
#define smtpd_policy_ttl_offset 2
#define smtpd_policy_try_delay_offset 3
#define smtpd_policy_def_action str_tgts[0] #define smtpd_policy_req_limit_offset 0
#define smtpd_policy_try_limit_offset 1
#define smtpd_policy_def_action_offset 0
/* policy_client_register - register policy service endpoint */ /* policy_client_register - register policy service endpoint */
@@ -511,9 +511,6 @@ static void policy_client_register(const char *name)
const char *sep = ", \t\r\n"; const char *sep = ", \t\r\n";
const char *parens = "{}"; const char *parens = "{}";
char *err; char *err;
int time_tgts[sizeof(time_table) / sizeof(time_table[0])];
int int_tgts[sizeof(int_table) / sizeof(int_table[0])];
const char *str_tgts[sizeof(str_table) / sizeof(str_table[0])];
if (policy_clnt_table == 0) if (policy_clnt_table == 0)
policy_clnt_table = htable_create(1); policy_clnt_table = htable_create(1);
@@ -523,13 +520,21 @@ static void policy_client_register(const char *name)
/* /*
* Allow per-service overrides for main.cf global settings. * Allow per-service overrides for main.cf global settings.
*/ */
smtpd_policy_tmout = var_smtpd_policy_tmout; int smtpd_policy_tmout = var_smtpd_policy_tmout;
smtpd_policy_idle = var_smtpd_policy_idle; int smtpd_policy_idle = var_smtpd_policy_idle;
smtpd_policy_ttl = var_smtpd_policy_ttl; int smtpd_policy_ttl = var_smtpd_policy_ttl;
smtpd_policy_req_limit = var_smtpd_policy_req_limit; int smtpd_policy_try_delay = var_smtpd_policy_try_delay;
smtpd_policy_try_limit = var_smtpd_policy_try_limit; int smtpd_policy_req_limit = var_smtpd_policy_req_limit;
smtpd_policy_try_delay = var_smtpd_policy_try_delay; int smtpd_policy_try_limit = var_smtpd_policy_try_limit;
smtpd_policy_def_action = var_smtpd_policy_def_action; const char *smtpd_policy_def_action = var_smtpd_policy_def_action;
link_override_table_to_variable(time_table, smtpd_policy_tmout);
link_override_table_to_variable(time_table, smtpd_policy_idle);
link_override_table_to_variable(time_table, smtpd_policy_ttl);
link_override_table_to_variable(time_table, smtpd_policy_try_delay);
link_override_table_to_variable(int_table, smtpd_policy_req_limit);
link_override_table_to_variable(int_table, smtpd_policy_try_limit);
link_override_table_to_variable(str_table, smtpd_policy_def_action);
if (*name == '{') { /* } */ if (*name == '{') { /* } */
cp = saved_name = mystrdup(name); cp = saved_name = mystrdup(name);
@@ -538,16 +543,14 @@ static void policy_client_register(const char *name)
if ((policy_name = mystrtok(&cp, sep)) == 0) if ((policy_name = mystrtok(&cp, sep)) == 0)
msg_fatal("empty policy service: \"%s\"", name); msg_fatal("empty policy service: \"%s\"", name);
attr_override(cp, sep, parens, attr_override(cp, sep, parens,
ATTR_OVER_TIME_TABLE, time_table, time_tgts, ATTR_OVER_TIME_TABLE, time_table,
ATTR_OVER_INT_TABLE, int_table, int_tgts, ATTR_OVER_INT_TABLE, int_table,
ATTR_OVER_STR_TABLE, str_table, str_tgts, ATTR_OVER_STR_TABLE, str_table,
0); 0);
} else { } else {
policy_name = name; policy_name = name;
} }
#if 0
if (msg_verbose) if (msg_verbose)
#endif
msg_info("%s: name=\"%s\" default_action=\"%s\" max_idle=%d " msg_info("%s: name=\"%s\" default_action=\"%s\" max_idle=%d "
"max_ttl=%d request_limit=%d retry_delay=%d " "max_ttl=%d request_limit=%d retry_delay=%d "
"timeout=%d try_limit=%d", "timeout=%d try_limit=%d",