2
0
mirror of https://github.com/vdukhovni/postfix synced 2025-08-30 05:38:06 +00:00

postfix-2.6-20080411

This commit is contained in:
Wietse Venema 2008-04-11 00:00:00 -05:00 committed by Viktor Dukhovni
parent 9bf0dc8741
commit fef0910080
15 changed files with 213 additions and 159 deletions

1
postfix/.indent.pro vendored
View File

@ -217,6 +217,7 @@
-TSMTPD_DEFER
-TSMTPD_RBL_EXPAND_CONTEXT
-TSMTPD_RBL_STATE
-TSMTPD_RCPTMAP_ST
-TSMTPD_STATE
-TSMTPD_TOKEN
-TSMTPD_XFORWARD_ATTR

View File

@ -14391,7 +14391,7 @@ Apologies for any names omitted.
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
@ -14401,5 +14401,19 @@ Apologies for any names omitted.
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.

View File

@ -107,7 +107,11 @@ Notes:
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

View File

@ -149,7 +149,12 @@ stress=
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

View File

@ -109,10 +109,10 @@ BOUNCE(5) BOUNCE(5)
<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:
@ -126,7 +126,7 @@ BOUNCE(5) BOUNCE(5)
<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

View File

@ -67,14 +67,13 @@ POSTMAP(1) POSTMAP(1)
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.
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.
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.
This feature is available in Postfix version 2.6
and later.
@ -106,15 +105,15 @@ POSTMAP(1) POSTMAP(1)
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.
lookup key with one or more embedded newline char-
acters.
By default, this processing of header content ends
at the first non-header line.
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.
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.
This feature is available in Postfix version 2.6
and later.
@ -124,7 +123,7 @@ POSTMAP(1) POSTMAP(1)
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
and later.

View File

@ -73,14 +73,13 @@ from standard input with "\fB-q -\fR", process the input
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"
@ -105,15 +104,15 @@ Enable message header query mode. When reading lookup keys
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
@ -121,7 +120,7 @@ Incremental mode. Read entries from standard input and do not
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

View File

@ -122,9 +122,9 @@ directory.
.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:
@ -136,7 +136,7 @@ The sender address in the message header of the delivery
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

View File

@ -149,7 +149,12 @@ stress=
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

View File

@ -110,9 +110,9 @@
# .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:
@ -124,7 +124,7 @@
# 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

View File

@ -20,7 +20,7 @@
* 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

View File

@ -311,6 +311,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
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.
@ -612,18 +613,24 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
* 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. */
@ -631,22 +638,27 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
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);

View File

@ -63,14 +63,13 @@
/* 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"
@ -95,15 +94,15 @@
/* 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
@ -111,7 +110,7 @@
/* 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

View File

@ -334,6 +334,7 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
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.
@ -653,18 +654,24 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
* 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. */
@ -672,22 +679,27 @@ static int qmgr_message_read(QMGR_MESSAGE *message)
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);

View File

@ -4300,6 +4300,8 @@ static int check_recipient_rcpt_maps(SMTPD_STATE *state, const char *recipient)
return (0);
if (state->recipient_rcptmap_checked == 1)
return (0);
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));
}
@ -4317,6 +4319,8 @@ static int check_sender_rcpt_maps(SMTPD_STATE *state, const char *sender)
return (0);
if (state->sender_rcptmap_checked == 1)
return (0);
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));
}