-TSMTPD_DEFER
-TSMTPD_RBL_EXPAND_CONTEXT
-TSMTPD_RBL_STATE
+-TSMTPD_RCPTMAP_ST
-TSMTPD_STATE
-TSMTPD_TOKEN
-TSMTPD_XFORWARD_ATTR
mistake of indenting if/endif blocks. Files: util/dict_pcre.c,
util/dict_regexp.c.
-20030824
+20080324
Cleanup: the event_drain() function is now a proper event
processing loop. File: util/events.c
message format. Specify -h or -b to use headers or body
lines as lookup keys, and specify -hm or -bm to simulate
header_checks or body_checks. The postmap -h option (without
- -m) will be compatible with a future postmap -h option.
+ -m) will be compatible with a future postcat -h option.
File: postmap/postmap.c.
+
+20040811
+
+ Bugfix (introduced Postfix 2.0): after "warn_if_reject
+ reject_unlisted_recipient/sender", the SMTP server mistakenly
+ remembered that recipient/sender validation was already
+ done. File: smtpd/smtpd_check.c.
+
+ Bugfix (introduced Postfix 2.3): the queue manager would
+ initialize missing client logging attributes (from xforward)
+ with real client attributes. Fix: enable this backwards
+ compatibility feature only with queue files that don't
+ contain logging attributes. Problem reported by Liviu Daia.
+ Files *qmgr/qmgr_message.c.
value must not contain null or newline.
* The "instance" attribute value can be used to correlate different requests
- regarding the same message delivery.
+ regarding the same message delivery. These requests are sent over the same
+ policy connection (unless the policy daemon terminates the connection).
+ Once Postfix sends a query with a different instance attribute over that
+ same policy connection, the previous message delivery is either completed
+ or aborted.
* The "size" attribute value specifies the message size that the client
specified in the MAIL FROM command (zero if none was specified). With
and an attribute value must not contain null or newline. </p>
<li> <p> The "instance" attribute value can be used to correlate
- different requests regarding the same message delivery. </p>
+ different requests regarding the same message delivery. These
+ requests are sent over the same policy connection (unless the
+ policy daemon terminates the connection). Once Postfix sends
+ a query with a different instance attribute over that same
+ policy connection, the previous message delivery is either
+ completed or aborted. </p>
<li> <p> The "size" attribute value specifies the message size
that the client specified in the MAIL FROM command (zero if
<b>TEMPLATE HEADER FORMAT</b>
The first portion of a bounce template consists of
- optional template headers. These either become message
- headers in the delivery status notification, or control
- the formatting of the notification. Headers not specified
- in a template will be left at their default value.
+ optional template headers. Some become message headers in
+ the delivery status notification; some control the format-
+ ting of that notification. Headers not specified in a tem-
+ plate will be left at their default value.
The following headers are supported:
<b>Subject:</b>
The subject in the message header of the delivery
- status notification.
+ status notification that is returned to the sender.
<b>Postmaster-Subject:</b>
- The subject that will be used in Postmaster copies
- of undeliverable or delayed mail notifications.
- These copies are sent under control of the
+ The subject that will be used in Postmaster copies
+ of undeliverable or delayed mail notifications.
+ These copies are sent under control of the
<a href="postconf.5.html#notify_classes">notify_classes</a> configuration parameter.
The usage and specification of template message headers is
subject to the following restrictions:
- <b>o</b> Template message header names can be specified in
- upper case, lower case or mixed case. Postfix
+ <b>o</b> Template message header names can be specified in
+ upper case, lower case or mixed case. Postfix
always produces bounce message header labels of the
form "<b>From:</b>" and "<b>Subject:</b>".
- <b>o</b> Template message headers must not span multiple
+ <b>o</b> Template message headers must not span multiple
lines.
- <b>o</b> Template message headers do not support $parameter
+ <b>o</b> Template message headers do not support $parameter
expansions.
<b>o</b> Template message headers must contain ASCII charac-
- ters only, and must not contain ASCII null charac-
+ ters only, and must not contain ASCII null charac-
ters.
<b>TEMPLATE MESSAGE TEXT FORMAT</b>
- The second portion of a bounce template consists of mes-
- sage text. As the above example shows, template message
- text may contain <a href="postconf.5.html">main.cf</a> $parameters. Besides the parame-
+ The second portion of a bounce template consists of mes-
+ sage text. As the above example shows, template message
+ text may contain <a href="postconf.5.html">main.cf</a> $parameters. Besides the parame-
ters that are defined in <a href="postconf.5.html">main.cf</a>, the following parameters
- are treated specially depending on the suffix that is
+ are treated specially depending on the suffix that is
appended to their name.
<b>delay_warning_time_</b><i>suffix</i>
- Expands into the value of the <b><a href="postconf.5.html#delay_warning_time">delay_warning_time</a></b>
- parameter, expressed in the time unit specified by
- <i>suffix</i>, which is one of <b>seconds</b>, <b>minutes</b>, <b>hours,</b>
+ Expands into the value of the <b><a href="postconf.5.html#delay_warning_time">delay_warning_time</a></b>
+ parameter, expressed in the time unit specified by
+ <i>suffix</i>, which is one of <b>seconds</b>, <b>minutes</b>, <b>hours,</b>
<b>days</b>, or <b>weeks</b>.
<b>maximal_queue_lifetime_</b><i>suffix</i>
- Expands into the value of the <b><a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_life</a>-</b>
- <b><a href="postconf.5.html#maximal_queue_lifetime">time</a></b> parameter, expressed in the time unit speci-
+ Expands into the value of the <b><a href="postconf.5.html#maximal_queue_lifetime">maximal_queue_life</a>-</b>
+ <b><a href="postconf.5.html#maximal_queue_lifetime">time</a></b> parameter, expressed in the time unit speci-
fied by <i>suffix</i>. See above under <b><a href="postconf.5.html#delay_warning_time">delay_warning_time</a></b>
for possible <i>suffix</i> values.
- The usage and specification of template message text is
+ The usage and specification of template message text is
subject to the following restrictions:
<b>o</b> The template message text is not sent in Postmaster
copies of delivery status notifications.
- <b>o</b> If the template message text contains non-ASCII
+ <b>o</b> If the template message text contains non-ASCII
characters, Postfix requires that the <b>Charset:</b> tem-
- plate header is updated. Specify an appropriate
+ plate header is updated. Specify an appropriate
superset of US-ASCII. A superset is needed because
- Postfix appends ASCII text after the message tem-
+ Postfix appends ASCII text after the message tem-
plate when it sends a delivery status notification.
<b>SEE ALSO</b>
<a href="postconf.5.html">postconf(5)</a>, configuration parameters
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>HISTORY</b>
- The Postfix bounce template format was originally devel-
+ The Postfix bounce template format was originally devel-
oped by Nicolas Riendeau.
<b>AUTHOR(S)</b>
mat. Each line of body content becomes one lookup
key.
- By default, this processing of body content starts
- at the first non-header line, and continues until
- the end of the message is reached.
+ By default, the <b>-b</b> option starts generating lookup
+ keys at the first non-header line, and stops when
+ the end of the message is reached. To simulate
+ <a href="header_checks.5.html"><b>body_checks</b>(5)</a> processing, enable MIME parsing with
+ <b>-m</b>. With this, the <b>-b</b> option generates no body-
+ style lookup keys for attachment MIME headers and
+ for attached message/* headers.
- To simulate <a href="header_checks.5.html"><b>body_checks</b>(5)</a> processing, enable MIME
- parsing with <b>-m</b>. With this, the <b>-b</b> option generates
- no body-style lookup keys from attachment MIME
- headers and from attached message/* headers.
-
- This feature is available in Postfix version 2.6
+ This feature is available in Postfix version 2.6
and later.
<b>-c</b> <i>config</i><b>_</b><i>dir</i>
- Read the <a href="postconf.5.html"><b>main.cf</b></a> configuration file in the named
+ Read the <a href="postconf.5.html"><b>main.cf</b></a> configuration file in the named
directory instead of the default configuration
directory.
- <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
- entry per map. The exit status is zero when the
+ <b>-d</b> <i>key</i> Search the specified maps for <i>key</i> and remove one
+ entry per map. The exit status is zero when the
requested information was found.
If a key value of <b>-</b> is specified, the program reads
key values from the standard input stream. The exit
- status is zero when at least one of the requested
+ status is zero when at least one of the requested
keys was found.
<b>-f</b> Do not fold the lookup key to lower case while cre-
ating or querying a table.
With Postfix version 2.3 and later, this option has
- no effect for regular expression tables. There,
+ no effect for regular expression tables. There,
case folding is controlled by appending a flag to a
pattern.
- <b>-h</b> Enable message header query mode. When reading
+ <b>-h</b> Enable message header query mode. When reading
lookup keys from standard input with "<b>-q -</b>",
- process the input as if it is an email message in
- <a href="http://tools.ietf.org/html/rfc2822">RFC 2822</a> format. Each logical header line becomes
- one lookup key. A multi-line header becomes one
- string with embedded newline characters.
-
- By default, this processing of header content ends
- at the first non-header line.
+ process the input as if it is an email message in
+ <a href="http://tools.ietf.org/html/rfc2822">RFC 2822</a> format. Each logical header line becomes
+ one lookup key. A multi-line header becomes one
+ lookup key with one or more embedded newline char-
+ acters.
+
+ By default, the <b>-h</b> option generates lookup keys
+ until the first non-header line is reached. To
+ simulate <a href="header_checks.5.html"><b>header_checks</b>(5)</a> processing, enable MIME
+ parsing with <b>-m</b>. With this, the <b>-h</b> option also gen-
+ erates header-style lookup keys for attachment MIME
+ headers and for attached message/* headers.
- To simulate <a href="header_checks.5.html"><b>header_checks</b>(5)</a> processing, enable
- MIME parsing with <b>-m</b>. With this, the <b>-h</b> option also
- generates header-style lookup keys from attachment
- MIME headers and from attached message/* headers.
-
- This feature is available in Postfix version 2.6
+ This feature is available in Postfix version 2.6
and later.
- <b>-i</b> Incremental mode. Read entries from standard input
+ <b>-i</b> Incremental mode. Read entries from standard input
and do not truncate an existing database. By
default, <a href="postmap.1.html"><b>postmap</b>(1)</a> creates a new database from the
entries in <b>file_name</b>.
- <b>-m</b> Enable MIME mode mode with "<b>-b</b>" and "<b>-h</b>".
+ <b>-m</b> Enable MIME parsing with "<b>-b</b>" and "<b>-h</b>".
- This feature is available in Postfix version 2.6
+ This feature is available in Postfix version 2.6
and later.
- <b>-N</b> Include the terminating null character that termi-
- nates lookup keys and values. By default,
- <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is the default for the
+ <b>-N</b> Include the terminating null character that termi-
+ nates lookup keys and values. By default,
+ <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is the default for the
host operating system.
- <b>-n</b> Don't include the terminating null character that
- terminates lookup keys and values. By default,
- <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is the default for the
+ <b>-n</b> Don't include the terminating null character that
+ terminates lookup keys and values. By default,
+ <a href="postmap.1.html"><b>postmap</b>(1)</a> does whatever is the default for the
host operating system.
- <b>-o</b> Do not release root privileges when processing a
- non-root input file. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> drops
- root privileges and runs as the source file owner
+ <b>-o</b> Do not release root privileges when processing a
+ non-root input file. By default, <a href="postmap.1.html"><b>postmap</b>(1)</a> drops
+ root privileges and runs as the source file owner
instead.
<b>-p</b> Do not inherit the file access permissions from the
input file when creating a new file. Instead, cre-
- ate a new file with default access permissions
+ ate a new file with default access permissions
(mode 0644).
- <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and write the
- first value found to the standard output stream.
+ <b>-q</b> <i>key</i> Search the specified maps for <i>key</i> and write the
+ first value found to the standard output stream.
The exit status is zero when the requested informa-
tion was found.
If a key value of <b>-</b> is specified, the program reads
- key values from the standard input stream and
- writes one line of <i>key value</i> output for each key
- that was found. The exit status is zero when at
+ key values from the standard input stream and
+ writes one line of <i>key value</i> output for each key
+ that was found. The exit status is zero when at
least one of the requested keys was found.
<b>-r</b> When updating a table, do not complain about
attempts to update existing entries, and make those
updates anyway.
- <b>-s</b> Retrieve all database elements, and write one line
- of <i>key value</i> output for each element. The elements
- are printed in database order, which is not neces-
+ <b>-s</b> Retrieve all database elements, and write one line
+ of <i>key value</i> output for each element. The elements
+ are printed in database order, which is not neces-
sarily the same as the original input order.
- This feature is available in Postfix version 2.2
- and later, and is not available for all database
+ This feature is available in Postfix version 2.2
+ and later, and is not available for all database
types.
<b>-v</b> Enable verbose logging for debugging purposes. Mul-
- tiple <b>-v</b> options make the software increasingly
+ tiple <b>-v</b> options make the software increasingly
verbose.
<b>-w</b> When updating a table, do not complain about
- attempts to update existing entries, and ignore
+ attempts to update existing entries, and ignore
those attempts.
Arguments:
<i>file</i><b>_</b><i>type</i>
- The database type. To find out what types are sup-
+ The database type. To find out what types are sup-
ported, use the "<b>postconf -m</b>" command.
The <a href="postmap.1.html"><b>postmap</b>(1)</a> command can query any supported file
- type, but it can create only the following file
+ type, but it can create only the following file
types:
- <b>btree</b> The output file is a btree file, named
- <i>file</i><b>_</b><i>name</i><b>.db</b>. This is available on systems
+ <b>btree</b> The output file is a btree file, named
+ <i>file</i><b>_</b><i>name</i><b>.db</b>. This is available on systems
with support for <b>db</b> databases.
<b>cdb</b> The output consists of one file, named
<i>file</i><b>_</b><i>name</i><b>.cdb</b>. This is available on systems
with support for <b>cdb</b> databases.
- <b>dbm</b> The output consists of two files, named
- <i>file</i><b>_</b><i>name</i><b>.pag</b> and <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is
- available on systems with support for <b>dbm</b>
+ <b>dbm</b> The output consists of two files, named
+ <i>file</i><b>_</b><i>name</i><b>.pag</b> and <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is
+ available on systems with support for <b>dbm</b>
databases.
- <b>hash</b> The output file is a hashed file, named
- <i>file</i><b>_</b><i>name</i><b>.db</b>. This is available on systems
+ <b>hash</b> The output file is a hashed file, named
+ <i>file</i><b>_</b><i>name</i><b>.db</b>. This is available on systems
with support for <b>db</b> databases.
- <b>sdbm</b> The output consists of two files, named
- <i>file</i><b>_</b><i>name</i><b>.pag</b> and <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is
- available on systems with support for <b>sdbm</b>
+ <b>sdbm</b> The output consists of two files, named
+ <i>file</i><b>_</b><i>name</i><b>.pag</b> and <i>file</i><b>_</b><i>name</i><b>.dir</b>. This is
+ available on systems with support for <b>sdbm</b>
databases.
- When no <i>file</i><b>_</b><i>type</i> is specified, the software uses
- the database type specified via the <b><a href="postconf.5.html#default_database_type">default_data</a>-</b>
+ When no <i>file</i><b>_</b><i>type</i> is specified, the software uses
+ the database type specified via the <b><a href="postconf.5.html#default_database_type">default_data</a>-</b>
<b><a href="postconf.5.html#default_database_type">base_type</a></b> configuration parameter.
<i>file</i><b>_</b><i>name</i>
- The name of the lookup table source file when
+ The name of the lookup table source file when
rebuilding a database.
<b>DIAGNOSTICS</b>
- Problems are logged to the standard error stream and to
- <b>syslogd</b>(8). No output means that no problems were
- detected. Duplicate entries are skipped and are flagged
+ Problems are logged to the standard error stream and to
+ <b>syslogd</b>(8). No output means that no problems were
+ detected. Duplicate entries are skipped and are flagged
with a warning.
- <a href="postmap.1.html"><b>postmap</b>(1)</a> terminates with zero exit status in case of
- success (including successful "<b>postmap -q</b>" lookup) and
+ <a href="postmap.1.html"><b>postmap</b>(1)</a> terminates with zero exit status in case of
+ success (including successful "<b>postmap -q</b>" lookup) and
terminates with non-zero exit status in case of failure.
<b>ENVIRONMENT</b>
Enable verbose logging for debugging purposes.
<b>CONFIGURATION PARAMETERS</b>
- The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant
+ The following <a href="postconf.5.html"><b>main.cf</b></a> parameters are especially relevant
to this program. The text below provides only a parameter
- summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including exam-
+ summary. See <a href="postconf.5.html"><b>postconf</b>(5)</a> for more details including exam-
ples.
<b><a href="postconf.5.html#berkeley_db_create_buffer_size">berkeley_db_create_buffer_size</a> (16777216)</b>
- The per-table I/O buffer size for programs that
+ The per-table I/O buffer size for programs that
create Berkeley DB hash or btree tables.
<b><a href="postconf.5.html#berkeley_db_read_buffer_size">berkeley_db_read_buffer_size</a> (131072)</b>
- The per-table I/O buffer size for programs that
+ The per-table I/O buffer size for programs that
read Berkeley DB hash or btree tables.
<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
+ The default location of the Postfix <a href="postconf.5.html">main.cf</a> and
<a href="master.5.html">master.cf</a> configuration files.
<b><a href="postconf.5.html#default_database_type">default_database_type</a> (see 'postconf -d' output)</b>
The syslog facility of Postfix logging.
<b><a href="postconf.5.html#syslog_name">syslog_name</a> (postfix)</b>
- The mail system name that is prepended to the
- process name in syslog records, so that "smtpd"
+ The mail system name that is prepended to the
+ process name in syslog records, so that "smtpd"
becomes, for example, "postfix/smtpd".
<b>SEE ALSO</b>
<a href="DATABASE_README.html">DATABASE_README</a>, Postfix lookup table overview
<b>LICENSE</b>
- The Secure Mailer license must be distributed with this
+ The Secure Mailer license must be distributed with this
software.
<b>AUTHOR(S)</b>
as if it is an email message in RFC 2822 format. Each line
of body content becomes one lookup key.
.sp
-By default, this processing of body content starts at the
-first non-header line, and continues until the end of the
-message is reached.
-.sp
+By default, the \fB-b\fR option starts generating lookup
+keys at the first non-header line, and stops when the end
+of the message is reached.
To simulate \fBbody_checks\fR(5) processing, enable MIME
parsing with \fB-m\fR. With this, the \fB-b\fR option
-generates no body-style lookup keys from attachment MIME
-headers and from attached message/* headers.
+generates no body-style lookup keys for attachment MIME
+headers and for attached message/* headers.
.sp
This feature is available in Postfix version 2.6 and later.
.IP "\fB-c \fIconfig_dir\fR"
from standard input with "\fB-q -\fR", process the input
as if it is an email message in RFC 2822 format. Each
logical header line becomes one lookup key. A multi-line
-header becomes one string with embedded newline characters.
-.sp
-By default, this processing of header content ends at the
-first non-header line.
+header becomes one lookup key with one or more embedded
+newline characters.
.sp
+By default, the \fB-h\fR option generates lookup keys until
+the first non-header line is reached.
To simulate \fBheader_checks\fR(5) processing, enable MIME
parsing with \fB-m\fR. With this, the \fB-h\fR option also
-generates header-style lookup keys from attachment MIME
-headers and from attached message/* headers.
+generates header-style lookup keys for attachment MIME
+headers and for attached message/* headers.
.sp
This feature is available in Postfix version 2.6 and later.
.IP \fB-i\fR
truncate an existing database. By default, \fBpostmap\fR(1) creates
a new database from the entries in \fBfile_name\fR.
.IP \fB-m\fR
-Enable MIME mode mode with "\fB-b\fR" and "\fB-h\fR".
+Enable MIME parsing with "\fB-b\fR" and "\fB-h\fR".
.sp
This feature is available in Postfix version 2.6 and later.
.IP \fB-N\fR
.ad
.fi
The first portion of a bounce template consists of optional
-template headers. These either become message headers in
-the delivery status notification, or control the formatting
-of the notification. Headers not specified in a template
+template headers. Some become message headers in the
+delivery status notification; some control the formatting
+of that notification. Headers not specified in a template
will be left at their default value.
The following headers are supported:
status notification.
.IP \fBSubject:\fR
The subject in the message header of the delivery status
-notification.
+notification that is returned to the sender.
.IP \fBPostmaster-Subject:\fR
The subject that will be used in Postmaster copies of
undeliverable or delayed mail notifications. These copies
and an attribute value must not contain null or newline. </p>
<li> <p> The "instance" attribute value can be used to correlate
- different requests regarding the same message delivery. </p>
+ different requests regarding the same message delivery. These
+ requests are sent over the same policy connection (unless the
+ policy daemon terminates the connection). Once Postfix sends
+ a query with a different instance attribute over that same
+ policy connection, the previous message delivery is either
+ completed or aborted. </p>
<li> <p> The "size" attribute value specifies the message size
that the client specified in the MAIL FROM command (zero if
# .ad
# .fi
# The first portion of a bounce template consists of optional
-# template headers. These either become message headers in
-# the delivery status notification, or control the formatting
-# of the notification. Headers not specified in a template
+# template headers. Some become message headers in the
+# delivery status notification; some control the formatting
+# of that notification. Headers not specified in a template
# will be left at their default value.
#
# The following headers are supported:
# status notification.
# .IP \fBSubject:\fR
# The subject in the message header of the delivery status
-# notification.
+# notification that is returned to the sender.
# .IP \fBPostmaster-Subject:\fR
# The subject that will be used in Postmaster copies of
# undeliverable or delayed mail notifications. These copies
* Patches change both the patchlevel and the release date. Snapshots have no
* patchlevel; they change the release date only.
*/
-#define MAIL_RELEASE_DATE "20080324"
+#define MAIL_RELEASE_DATE "20080411"
#define MAIL_VERSION_NUMBER "2.6"
#ifdef SNAPSHOT
int dsn_notify = 0;
char *dsn_orcpt = 0;
int n;
+ int have_log_client_attr = 0;
/*
* Initialize. No early returns or we have a memory leak.
* client information. To support old queue files, we accept both
* names for the purpose of logging; the new name overrides the
* old one.
+ *
+ * XXX Do not use the "legacy" client_name etc. attribute values for
+ * initializing the logging attributes, when this file already
+ * contains the "modern" log_client_name etc. logging attributes.
+ * Otherwise, logging attributes that are not present in the
+ * queue file would be set with information from the real client.
*/
else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_NAME) == 0) {
- if (message->client_name == 0)
+ if (have_log_client_attr == 0 && message->client_name == 0)
message->client_name = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_ADDR) == 0) {
- if (message->client_addr == 0)
+ if (have_log_client_attr == 0 && message->client_addr == 0)
message->client_addr = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_PROTO_NAME) == 0) {
- if (message->client_proto == 0)
+ if (have_log_client_attr == 0 && message->client_proto == 0)
message->client_proto = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
- if (message->client_helo == 0)
+ if (have_log_client_attr == 0 && message->client_helo == 0)
message->client_helo = mystrdup(value);
}
/* Original client attributes. */
if (message->client_name != 0)
myfree(message->client_name);
message->client_name = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_ADDR) == 0) {
if (message->client_addr != 0)
myfree(message->client_addr);
message->client_addr = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_PORT) == 0) {
if (message->client_port != 0)
myfree(message->client_port);
message->client_port = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_PROTO_NAME) == 0) {
if (message->client_proto != 0)
myfree(message->client_proto);
message->client_proto = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_HELO_NAME) == 0) {
if (message->client_helo != 0)
myfree(message->client_helo);
message->client_helo = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_SASL_METHOD) == 0) {
if (message->sasl_method == 0)
message->sasl_method = mystrdup(value);
/* as if it is an email message in RFC 2822 format. Each line
/* of body content becomes one lookup key.
/* .sp
-/* By default, this processing of body content starts at the
-/* first non-header line, and continues until the end of the
-/* message is reached.
-/* .sp
+/* By default, the \fB-b\fR option starts generating lookup
+/* keys at the first non-header line, and stops when the end
+/* of the message is reached.
/* To simulate \fBbody_checks\fR(5) processing, enable MIME
/* parsing with \fB-m\fR. With this, the \fB-b\fR option
-/* generates no body-style lookup keys from attachment MIME
-/* headers and from attached message/* headers.
+/* generates no body-style lookup keys for attachment MIME
+/* headers and for attached message/* headers.
/* .sp
/* This feature is available in Postfix version 2.6 and later.
/* .IP "\fB-c \fIconfig_dir\fR"
/* from standard input with "\fB-q -\fR", process the input
/* as if it is an email message in RFC 2822 format. Each
/* logical header line becomes one lookup key. A multi-line
-/* header becomes one string with embedded newline characters.
-/* .sp
-/* By default, this processing of header content ends at the
-/* first non-header line.
+/* header becomes one lookup key with one or more embedded
+/* newline characters.
/* .sp
+/* By default, the \fB-h\fR option generates lookup keys until
+/* the first non-header line is reached.
/* To simulate \fBheader_checks\fR(5) processing, enable MIME
/* parsing with \fB-m\fR. With this, the \fB-h\fR option also
-/* generates header-style lookup keys from attachment MIME
-/* headers and from attached message/* headers.
+/* generates header-style lookup keys for attachment MIME
+/* headers and for attached message/* headers.
/* .sp
/* This feature is available in Postfix version 2.6 and later.
/* .IP \fB-i\fR
/* truncate an existing database. By default, \fBpostmap\fR(1) creates
/* a new database from the entries in \fBfile_name\fR.
/* .IP \fB-m\fR
-/* Enable MIME mode mode with "\fB-b\fR" and "\fB-h\fR".
+/* Enable MIME parsing with "\fB-b\fR" and "\fB-h\fR".
/* .sp
/* This feature is available in Postfix version 2.6 and later.
/* .IP \fB-N\fR
int dsn_notify = 0;
char *dsn_orcpt = 0;
int n;
+ int have_log_client_attr = 0;
/*
* Initialize. No early returns or we have a memory leak.
* client information. To support old queue files we accept both
* names for the purpose of logging; the new name overrides the
* old one.
+ *
+ * XXX Do not use the "legacy" client_name etc. attribute values for
+ * initializing the logging attributes, when this file already
+ * contains the "modern" log_client_name etc. logging attributes.
+ * Otherwise, logging attributes that are not present in the
+ * queue file would be set with information from the real client.
*/
else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_NAME) == 0) {
- if (message->client_name == 0)
+ if (have_log_client_attr == 0 && message->client_name == 0)
message->client_name = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_CLIENT_ADDR) == 0) {
- if (message->client_addr == 0)
+ if (have_log_client_attr == 0 && message->client_addr == 0)
message->client_addr = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_PROTO_NAME) == 0) {
- if (message->client_proto == 0)
+ if (have_log_client_attr == 0 && message->client_proto == 0)
message->client_proto = mystrdup(value);
} else if (strcmp(name, MAIL_ATTR_ACT_HELO_NAME) == 0) {
- if (message->client_helo == 0)
+ if (have_log_client_attr == 0 && message->client_helo == 0)
message->client_helo = mystrdup(value);
}
/* Original client attributes. */
if (message->client_name != 0)
myfree(message->client_name);
message->client_name = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_ADDR) == 0) {
if (message->client_addr != 0)
myfree(message->client_addr);
message->client_addr = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_CLIENT_PORT) == 0) {
if (message->client_port != 0)
myfree(message->client_port);
message->client_port = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_PROTO_NAME) == 0) {
if (message->client_proto != 0)
myfree(message->client_proto);
message->client_proto = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_LOG_HELO_NAME) == 0) {
if (message->client_helo != 0)
myfree(message->client_helo);
message->client_helo = mystrdup(value);
+ have_log_client_attr = 1;
} else if (strcmp(name, MAIL_ATTR_SASL_METHOD) == 0) {
if (message->sasl_method == 0)
message->sasl_method = mystrdup(value);
return (0);
if (state->recipient_rcptmap_checked == 1)
return (0);
- state->recipient_rcptmap_checked = 1;
+ if (state->warn_if_reject == 0)
+ /* We really validate the recipient address. */
+ state->recipient_rcptmap_checked = 1;
return (check_rcpt_maps(state, recipient, SMTPD_NAME_RECIPIENT));
}
return (0);
if (state->sender_rcptmap_checked == 1)
return (0);
- state->sender_rcptmap_checked = 1;
+ if (state->warn_if_reject == 0)
+ /* We really validate the sender address. */
+ state->sender_rcptmap_checked = 1;
return (check_rcpt_maps(state, sender, SMTPD_NAME_SENDER));
}