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

postfix-2.4-20060725

This commit is contained in:
Wietse Venema
2006-07-25 00:00:00 -05:00
committed by Viktor Dukhovni
parent 21b0834aa1
commit 315b0f33ca
8 changed files with 80 additions and 4 deletions

View File

@@ -12612,6 +12612,16 @@ Apologies for any names omitted.
Postfix Milter client created a queue file that caused
delivery agents to loop. File: cleanup/cleanup_milter.c.
20060725
Bugfix: damaged queue file record after a Milter request
to modify a message header when 1) it was the last header
in the unmodified message, and 2) the old header was less
than 15 characters long. File: cleanup/cleanup_milter.c.
Bugfix: don't panic in smtp_rcpt_cleanup() after detecting
a damaged queue file record. File: smtp/smtp_proto.c.
Wish list:
Add M flag (enable multi-recipient delivery) to pipe daemon.

View File

@@ -65,7 +65,7 @@ cleanup_milter: cleanup_milter.o $(CLEANUP_MILTER_OBJS)
$(CC) $(CFLAGS) -DTEST -o $@ $@.c $(CLEANUP_MILTER_OBJS) $(LIBS) $(SYSLIBS)
mv junk cleanup_milter.o
tests: cleanup_masquerade_test cleanup_milter_test
tests: cleanup_masquerade_test cleanup_milter_test cleanup_milter_test2
root_tests:
@@ -93,6 +93,15 @@ cleanup_milter_test: cleanup_milter cleanup_milter.in1 cleanup_milter.ref1 \
diff cleanup_milter.ref1 cleanup_milter.tmp
rm -f test-queue-file.tmp cleanup_milter.tmp
cleanup_milter_test2: cleanup_milter cleanup_milter.in2 cleanup_milter.ref2 \
test-queue-file2 ../postcat/postcat
cp test-queue-file2 test-queue-file2.tmp
chmod u+w test-queue-file2.tmp
./cleanup_milter <cleanup_milter.in2
../postcat/postcat -ov test-queue-file2.tmp 2>/dev/null >cleanup_milter.tmp
diff cleanup_milter.ref2 cleanup_milter.tmp
rm -f test-queue-file2.tmp cleanup_milter.tmp
depend: $(MAKES)
(sed '1,/^# do not edit/!d' Makefile.in; \
set -e; for i in [a-z][a-z0-9]*.c; do \

View File

@@ -623,7 +623,12 @@ static const char *cleanup_patch_header(CLEANUP_STATE *state,
msg_warn("%s: seek file %s: %m", myname, cleanup_path);
CLEANUP_PATCH_HEADER_RETURN(cleanup_milter_error(state, errno));
}
CLEANUP_OUT_BUF(state, rec_type, buf);
/* The saved "append header" pointer record may still contain "0". */
if (saved_read_offset == state->append_hdr_pt_offset)
cleanup_out_format(state, REC_TYPE_PTR, REC_TYPE_PTR_FORMAT,
(long) state->append_hdr_pt_target);
else
CLEANUP_OUT_BUF(state, rec_type, buf);
if (msg_verbose > 1)
msg_info("%s: %ld: write %.*s", myname, (long) write_offset,
LEN(buf) > 30 ? 30 : (int) LEN(buf), STR(buf));
@@ -825,6 +830,9 @@ static const char *cleanup_upd_header(void *context, ssize_t index,
CLEANUP_UPD_HEADER_RETURN(cleanup_milter_error(state, errno));
}
if (rec_type == REC_TYPE_PTR) {
/* The "append header" pointer record content must be saved. */
if (saved_read_offset == state->append_hdr_pt_offset)
break;
if (jumped == 0) {
/* Enough contiguous space for writing a PTR record. */
avail_space += read_offset - saved_read_offset;

View File

@@ -0,0 +1,10 @@
#verbose on
open test-queue-file2.tmp
upd_header 1 Subject hey!
upd_header 1 Subject hey!
upd_header 1 Subject hey!
add_header foo foobar
upd_header 1 foo foobar
upd_header 1 foo foobar
upd_header 1 foo foobar
close

View File

@@ -0,0 +1,32 @@
*** ENVELOPE RECORDS test-queue-file2.tmp ***
0 message_size: 329 181 1 0
65 message_arrival_time: Tue Jul 25 15:37:06 2006
82 create_time: Tue Jul 25 15:37:06 2006
106 named_attribute: rewrite_context=local
129 sender_fullname: Wietse Venema
144 sender: me@porcupine.org
162 pointer_record: 0
179 *** MESSAGE CONTENTS test-queue-file2.tmp ***
181 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0)
243 regular_text: id 034B229013F; Tue, 25 Jul 2006 15:37:06 -0400 (EDT)
299 regular_text: From: me@porcupine.org
323 regular_text: To: you@porcupine.org
346 regular_text: Message-Id: <20060725192735.5EC2D29013F@hades.porcupine.org>
408 regular_text: Date: Tue, 25 Jul 2006 15:27:19 -0400 (EDT)
453 pointer_record: 552
552 pointer_record: 584
584 pointer_record: 616
616 regular_text: Subject: hey!
631 pointer_record: 648
648 pointer_record: 678
678 pointer_record: 708
708 pointer_record: 738
738 regular_text: foo: foobar
751 pointer_record: 485
485 regular_text:
487 regular_text: text
493 pointer_record: 0
510 *** HEADER EXTRACTED test-queue-file2.tmp ***
512 original_recipient: you@porcupine.org
531 recipient: you@porcupine.org
550 *** MESSAGE FILE END test-queue-file2.tmp ***

Binary file not shown.

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 "20060724"
#define MAIL_RELEASE_DATE "20060725"
#define MAIL_VERSION_NUMBER "2.4"
#ifdef SNAPSHOT

View File

@@ -987,6 +987,8 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
NOCLOBBER int mail_from_rejected;
NOCLOBBER int downgrading;
int mime_errs;
SMTP_RESP fake;
int fail_status;
/*
* Macros for readability.
@@ -1696,7 +1698,12 @@ static int smtp_loop(SMTP_STATE *state, NOCLOBBER int send_state,
if (rec_type != REC_TYPE_XTRA) {
msg_warn("%s: bad record type: %d in message content",
request->queue_id, rec_type);
RETURN(mark_corrupt(state->src));
fail_status = smtp_mesg_fail(state, DSN_BY_LOCAL_MTA,
SMTP_RESP_FAKE(&fake, "5.3.0"),
"unreadable mail queue entry");
if (fail_status == 0)
(void) mark_corrupt(state->src);
RETURN(fail_status);
}
}