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

postfix-2.4.4-RC1

This commit is contained in:
Wietse Venema 2007-06-14 00:00:00 -05:00 committed by Viktor Dukhovni
parent 876daa6cbd
commit 1693a43386
7 changed files with 89 additions and 38 deletions

View File

@ -13481,3 +13481,13 @@ Apologies for any names omitted.
Portability: Victor helpfully pointed out that change Portability: Victor helpfully pointed out that change
20070425 broke on non-IPv6 systems. Files: smtpd/smtpd_peer.c, 20070425 broke on non-IPv6 systems. Files: smtpd/smtpd_peer.c,
qmqpd/qmqpd_peer.c. qmqpd/qmqpd_peer.c.
20070613
Bugfix: the Milter client assumed that a Milter application
does not modify the message header or envelope, after that
same Milter application has modified the message body of
that same email message. This is not a problem with updates
by different Milter applications. Problem was triggered
by Jose-Marcio Martins da Cruz. Also simplified the handling
of queue file update errors. File: milter/milter8.c.

View File

@ -53,6 +53,8 @@ recursively replaced by the value of the named parameter. </p>
"$name" is empty. This form is supported with Postfix version 2.2 "$name" is empty. This form is supported with Postfix version 2.2
and later. </p> and later. </p>
<li> <p> Specify "$$" to produce a single "$" character. </p>
</ul> </ul>
<li> <p> When the same parameter is defined multiple times, only <li> <p> When the same parameter is defined multiple times, only

View File

@ -42,6 +42,8 @@ version 2.2 and later.
The expression "${name:value}" expands to "value" when The expression "${name:value}" expands to "value" when
"$name" is empty. This form is supported with Postfix "$name" is empty. This form is supported with Postfix
version 2.2 and later. version 2.2 and later.
.IP \(bu
Specify "$$" to produce a single "$" character.
.RE .RE
.IP \(bu .IP \(bu
When the same parameter is defined multiple times, only the last When the same parameter is defined multiple times, only the last

View File

@ -53,6 +53,8 @@ recursively replaced by the value of the named parameter. </p>
"$name" is empty. This form is supported with Postfix version 2.2 "$name" is empty. This form is supported with Postfix version 2.2
and later. </p> and later. </p>
<li> <p> Specify "$$" to produce a single "$" character. </p>
</ul> </ul>
<li> <p> When the same parameter is defined multiple times, only <li> <p> When the same parameter is defined multiple times, only

View File

@ -42,6 +42,8 @@ version 2.2 and later.
The expression "${name:value}" expands to "value" when The expression "${name:value}" expands to "value" when
"$name" is empty. This form is supported with Postfix "$name" is empty. This form is supported with Postfix
version 2.2 and later. version 2.2 and later.
.IP \(bu
Specify "$$" to produce a single "$" character.
.RE .RE
.IP \(bu .IP \(bu
When the same parameter is defined multiple times, only the last When the same parameter is defined multiple times, only the last

View File

@ -20,8 +20,8 @@
* 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 "20070531" #define MAIL_RELEASE_DATE "20070614"
#define MAIL_VERSION_NUMBER "2.4.3" #define MAIL_VERSION_NUMBER "2.4.4-RC1"
#ifdef SNAPSHOT #ifdef SNAPSHOT
# define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE # define MAIL_VERSION_DATE "-" MAIL_RELEASE_DATE

View File

@ -475,6 +475,28 @@ static int milter8_comm_error(MILTER8 *milter)
return (milter->state = MILTER8_STAT_ERROR); return (milter->state = MILTER8_STAT_ERROR);
} }
/* milter8_edit_error - local queue file update error */
static void milter8_edit_error(MILTER8 *milter, const char *reply)
{
/*
* Close the socket, so we don't have to skip pending replies from this
* Milter instance.
*/
if (milter->fp != 0) {
(void) vstream_fclose(milter->fp);
milter->fp = 0;
}
/*
* Set the socket state to ERROR, so we don't try to send further MTA
* events to this Milter instance.
*/
milter8_def_reply(milter, reply);
milter->state = MILTER8_STAT_ERROR;
}
/* milter8_close_stream - close stream to milter application */ /* milter8_close_stream - close stream to milter application */
static void milter8_close_stream(MILTER8 *milter) static void milter8_close_stream(MILTER8 *milter)
@ -1002,6 +1024,27 @@ static const char *milter8_event(MILTER8 *milter, int event,
msg_info("reply: %s data %ld bytes", msg_info("reply: %s data %ld bytes",
(smfir_name = str_name_code(smfir_table, cmd)) != 0 ? (smfir_name = str_name_code(smfir_table, cmd)) != 0 ?
smfir_name : "unknown", (long) data_size); smfir_name : "unknown", (long) data_size);
/*
* Handle unfinished message body replacement first.
*/
if (body_line_buf != 0 && cmd != SMFIR_REPLBODY) {
/* In case the last body replacement line didn't end in CRLF. */
if (LEN(body_line_buf) > 0)
edit_resp = parent->repl_body(parent->chg_context,
MILTER_BODY_LINE,
body_line_buf);
if (edit_resp == 0)
edit_resp = parent->repl_body(parent->chg_context,
MILTER_BODY_END,
(VSTRING *) 0);
if (edit_resp) {
milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
vstring_free(body_line_buf);
body_line_buf = 0;
}
switch (cmd) { switch (cmd) {
/* /*
@ -1212,8 +1255,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
edit_resp = parent->del_header(parent->chg_context, edit_resp = parent->del_header(parent->chg_context,
(ssize_t) index, (ssize_t) index,
STR(milter->buf)); STR(milter->buf));
if (edit_resp) if (edit_resp) {
MILTER8_EVENT_BREAK(edit_resp); milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
#endif #endif
@ -1229,8 +1274,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
edit_resp = parent->add_header(parent->chg_context, edit_resp = parent->add_header(parent->chg_context,
STR(milter->buf), STR(milter->buf),
STR(milter->body)); STR(milter->body));
if (edit_resp) if (edit_resp) {
MILTER8_EVENT_BREAK(edit_resp); milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
/* /*
@ -1257,8 +1304,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
(ssize_t) index + 1, (ssize_t) index + 1,
STR(milter->buf), STR(milter->buf),
STR(milter->body)); STR(milter->body));
if (edit_resp) if (edit_resp) {
MILTER8_EVENT_BREAK(edit_resp); milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
#endif #endif
@ -1272,8 +1321,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
MILTER8_EVENT_BREAK(milter->def_reply); MILTER8_EVENT_BREAK(milter->def_reply);
edit_resp = parent->add_rcpt(parent->chg_context, edit_resp = parent->add_rcpt(parent->chg_context,
STR(milter->buf)); STR(milter->buf));
if (edit_resp) if (edit_resp) {
MILTER8_EVENT_BREAK(edit_resp); milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
/* /*
@ -1286,8 +1337,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
MILTER8_EVENT_BREAK(milter->def_reply); MILTER8_EVENT_BREAK(milter->def_reply);
edit_resp = parent->del_rcpt(parent->chg_context, edit_resp = parent->del_rcpt(parent->chg_context,
STR(milter->buf)); STR(milter->buf));
if (edit_resp) if (edit_resp) {
MILTER8_EVENT_BREAK(edit_resp); milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
/* /*
@ -1323,6 +1376,10 @@ static const char *milter8_event(MILTER8 *milter, int event,
VSTRING_ADDCH(body_line_buf, ch); VSTRING_ADDCH(body_line_buf, ch);
} }
} }
if (edit_resp) {
milter8_edit_error(milter, edit_resp);
MILTER8_EVENT_BREAK(milter->def_reply);
}
continue; continue;
} }
} }
@ -1348,35 +1405,11 @@ static const char *milter8_event(MILTER8 *milter, int event,
} }
/* /*
* Finish message body replacement. * Clean up after aborted message body replacement.
*/ */
if (body_line_buf != 0) { if (body_line_buf)
if (edit_resp == 0) {
/* In case the last body replacement line didn't end in CRLF. */
if (LEN(body_line_buf) > 0)
edit_resp = parent->repl_body(parent->chg_context,
MILTER_BODY_LINE,
body_line_buf);
if (edit_resp == 0)
edit_resp = parent->repl_body(parent->chg_context,
MILTER_BODY_END,
(VSTRING *) 0);
}
vstring_free(body_line_buf); vstring_free(body_line_buf);
/*
* Override a non-reject/discard result value after body replacement
* failure.
*
* XXX Some cleanup clients ask the cleanup server to bounce mail for
* them. In that case we must override a hard reject retval result
* after queue file update failure. This is not a big problem; the
* odds are small that a Milter application sends a hard reject after
* replacing the message body.
*/
if (edit_resp && (retval == 0 || strchr("DS4", retval[0]) == 0))
retval = edit_resp;
}
return (retval); return (retval);
} }