From: Wietse Venema Date: Thu, 21 Dec 2006 05:00:00 +0000 (-0500) Subject: postfix-2.4-20061221 X-Git-Tag: v2.4.0-RC1~28 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aa829595a8263d9f7a6b41073568eacbad6100e6;p=thirdparty%2Fpostfix.git postfix-2.4-20061221 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 8c1e6ede6..37bc435e4 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -13011,6 +13011,12 @@ Apologies for any names omitted. deferred queue to the incoming queue. Files: flush/flush.c, qmgr/qmgr_scan.c. + Cleanup: the sendmail and postqueue commands no longer + terminate with a non-standard error status after a run-time + error in some Postfix internal routine (typically, some + essential file is not accessible, or the system is out of + memory). Files: sendmail/sendmail.c, postqueue/postqueue.c. + Feature: "sendmail -qIqueueid" and "postqueue -i queueid" to flush a specific queue file. Files: sendmail/sendmail.c, postqueue/postqueue.c, global/flush_clnt.c, flush/flush.c. @@ -13025,6 +13031,20 @@ Apologies for any names omitted. flush/flush.c, *qmgr/qmgr.c, *qmgr/qmgr_scan.c, *qmgr/qmgr_active.c, *qmgr/qmgr_message.c. +20061220 + + Workaround: PMilter 0.95 does not deliver SMFIC_EOB+data + to the application as SMFIC_BODY+data followed by SMFIC_EOB. + To avoid compatibility problems, Postfix now sends + SMFIC_BODY+data followed by SMFIC_EOB. File: milter/milter8.c. + + Bugfix (introduced with Postfix 2.3): when inserting + Milter-generated headers at increasing positions in a + message, a later header could end up at a previously used + insertion point. Thus, inserting headers at positions (N, + N+M) could work as if (N, N) had been specified. Problem + reported by Mark Martinec. File: milter/milter8.c. + Wish list: Update MILTER_README with Martinec info. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index c10dd823e..8f14d7827 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -21,9 +21,16 @@ Incompatible changes with Postfix snapshot 20061217 =================================================== Postfix no longer requires a domain name. It uses "localdomain" as -the default Internet domain name when no domain is specified in -main.cf, and when the machine hostname does not include domain name -information. +the default Internet domain name when no domain is specified via +main.cf or via the machine's hostname. + +Major changes with Postfix snapshot 20061217 +============================================ + +More precise queue flushing with the ETRN, "postqueue -s site", and +"sendmail -qRsite" commands, after minimization of race conditions. +New per-queue-file flushing with "postqueue -i queueid" and "sendmail +-qIqueueid". Incompatible changes with Postfix snapshot 20061209 =================================================== diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index c1e0f2b4c..03fbe53db 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -2088,7 +2088,7 @@ The default time unit is s (seconds).

Disable DNS lookups in the Postfix SMTP and LMTP clients. When -disabled, hosts are looked up with the gethostbyname() system +disabled, hosts are looked up with the getaddrinfo() system library routine which normally also looks in /etc/hosts.

@@ -9247,7 +9247,7 @@ This feature is available in Postfix 2.0 and later.
Reject the request when the client hostname is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, reject -the request when the reversed client network address is listed with +the request when the client hostname is listed with any A record under rbl_domain. See the reject_rbl_client description above for additional RBL related configuration parameters. This feature is available in Postfix 2.0 and later.
@@ -10156,7 +10156,7 @@ rejected requests (default: 504).
Reject the request when the RCPT TO domain is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, reject -the request when the reversed client network address is listed with +the request when the RCPT TO domain is listed with any A record under rbl_domain.
The maps_rbl_reject_code parameter specifies the response code for rejected requests (default: 554); the default_rbl_reply parameter specifies the default server @@ -10668,7 +10668,7 @@ rejected requests (default: 504).
Reject the request when the MAIL FROM domain is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, -reject the request when the reversed client network address is +reject the request when the MAIL FROM domain is listed with any A record under rbl_domain.
The maps_rbl_reject_code parameter specifies the response code for rejected requests (default: 554); the default_rbl_reply parameter diff --git a/postfix/html/postqueue.1.html b/postfix/html/postqueue.1.html index 0a96c5486..6061cfa58 100644 --- a/postfix/html/postqueue.1.html +++ b/postfix/html/postqueue.1.html @@ -43,10 +43,14 @@ POSTQUEUE(1) POSTQUEUE(1) other mail. -i queue_id - Schedule immediate delivery of mail with the speci- - fied queue ID. This feature uses the flush(8) - server, and is available with Postfix 2.4 and - later. + Schedule immediate delivery of deferred mail with + the specified queue ID. + + This option implements the traditional sendmail -qI + command, by contacting the flush(8) server. + + This feature is available with Postfix version 2.4 + and later. -p Produce a traditional sendmail-style queue listing. This option implements the traditional mailq com- diff --git a/postfix/man/man1/postqueue.1 b/postfix/man/man1/postqueue.1 index 79a49f6af..a6f51534c 100644 --- a/postfix/man/man1/postqueue.1 +++ b/postfix/man/man1/postqueue.1 @@ -39,9 +39,13 @@ by contacting the Postfix \fBqmgr\fR(8) daemon. Warning: flushing undeliverable mail frequently will result in poor delivery performance of all other mail. .IP "\fB-i \fIqueue_id\fR" -Schedule immediate delivery of mail with the specified queue ID. -This feature uses the \fBflush\fR(8) server, and is available -with Postfix 2.4 and later. +Schedule immediate delivery of deferred mail with the +specified queue ID. + +This option implements the traditional \fBsendmail -qI\fR +command, by contacting the \fBflush\fR(8) server. + +This feature is available with Postfix version 2.4 and later. .IP \fB-p\fR Produce a traditional sendmail-style queue listing. This option implements the traditional \fBmailq\fR command, diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index 22a49f1bb..64c3e303c 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -1132,7 +1132,7 @@ Time units: s (seconds), m (minutes), h (hours), d (days), w (weeks). The default time unit is s (seconds). .SH disable_dns_lookups (default: no) Disable DNS lookups in the Postfix SMTP and LMTP clients. When -disabled, hosts are looked up with the gethostbyname() system +disabled, hosts are looked up with the getaddrinfo() system library routine which normally also looks in /etc/hosts. .PP DNS lookups are enabled by default. @@ -5451,7 +5451,7 @@ This feature is available in Postfix 2.0 and later. Reject the request when the client hostname is listed with the A record "\fId.d.d.d\fR" under \fIrbl_domain\fR (Postfix version 2.1 and later only). If no "\fI=d.d.d.d\fR" is specified, reject -the request when the reversed client network address is listed with +the request when the client hostname is listed with any A record under \fIrbl_domain\fR. See the reject_rbl_client description above for additional RBL related configuration parameters. This feature is available in Postfix 2.0 and later. @@ -6025,7 +6025,7 @@ rejected requests (default: 504). Reject the request when the RCPT TO domain is listed with the A record "\fId.d.d.d\fR" under \fIrbl_domain\fR (Postfix version 2.1 and later only). If no "\fI=d.d.d.d\fR" is specified, reject -the request when the reversed client network address is listed with +the request when the RCPT TO domain is listed with any A record under \fIrbl_domain\fR. .br The maps_rbl_reject_code @@ -6359,7 +6359,7 @@ rejected requests (default: 504). Reject the request when the MAIL FROM domain is listed with the A record "\fId.d.d.d\fR" under \fIrbl_domain\fR (Postfix version 2.1 and later only). If no "\fI=d.d.d.d\fR" is specified, -reject the request when the reversed client network address is +reject the request when the MAIL FROM domain is listed with any A record under \fIrbl_domain\fR. .br The diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index e73e49847..abbd8714b 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -4635,7 +4635,7 @@ This feature is available in Postfix 2.0 and later.
Reject the request when the client hostname is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, reject -the request when the reversed client network address is listed with +the request when the client hostname is listed with any A record under rbl_domain. See the reject_rbl_client description above for additional RBL related configuration parameters. This feature is available in Postfix 2.0 and later.
@@ -5305,7 +5305,7 @@ rejected requests (default: 504).
Reject the request when the RCPT TO domain is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, reject -the request when the reversed client network address is listed with +the request when the RCPT TO domain is listed with any A record under rbl_domain.
The maps_rbl_reject_code parameter specifies the response code for rejected requests (default: 554); the default_rbl_reply parameter specifies the default server @@ -5656,7 +5656,7 @@ rejected requests (default: 504).
Reject the request when the MAIL FROM domain is listed with the A record "d.d.d.d" under rbl_domain (Postfix version 2.1 and later only). If no "=d.d.d.d" is specified, -reject the request when the reversed client network address is +reject the request when the MAIL FROM domain is listed with any A record under rbl_domain.
The maps_rbl_reject_code parameter specifies the response code for rejected requests (default: 554); the default_rbl_reply parameter @@ -6591,7 +6591,7 @@ The default time unit is h (hours).

Disable DNS lookups in the Postfix SMTP and LMTP clients. When -disabled, hosts are looked up with the gethostbyname() system +disabled, hosts are looked up with the getaddrinfo() system library routine which normally also looks in /etc/hosts.

diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in index 2b1993750..2bf737122 100644 --- a/postfix/src/cleanup/Makefile.in +++ b/postfix/src/cleanup/Makefile.in @@ -67,7 +67,7 @@ cleanup_milter: cleanup_milter.o $(CLEANUP_MILTER_OBJS) $(LIBS) tests: cleanup_masquerade_test cleanup_milter_test bug_tests \ cleanup_milter_test2 cleanup_milter_test3 cleanup_milter_test4 \ - cleanup_milter_test5 + cleanup_milter_test5 cleanup_milter_test6 cleanup_milter_test7 root_tests: @@ -166,6 +166,57 @@ cleanup_milter_test5: cleanup_milter test-queue-file5 cleanup_milter.in5 \ diff cleanup_milter.ref5 cleanup_milter.tmp rm -f test-queue-file5.tmp cleanup_milter.tmp +cleanup_milter_test6: cleanup_milter_test6a cleanup_milter_test6b cleanup_milter_test6c + rm -f test-queue-file6.tmp cleanup_milter.tmp + +cleanup_milter_test6a: cleanup_milter test-queue-file6 cleanup_milter.in6a \ + cleanup_milter.ref6a test-queue-file6 ../postcat/postcat + cp test-queue-file6 test-queue-file6.tmp + chmod u+w test-queue-file6.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref6a cleanup_milter.tmp + +cleanup_milter_test6b: cleanup_milter test-queue-file6 cleanup_milter.in6b \ + cleanup_milter.ref6b test-queue-file6 ../postcat/postcat + cp test-queue-file6 test-queue-file6.tmp + chmod u+w test-queue-file6.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref6b cleanup_milter.tmp + +cleanup_milter_test6c: cleanup_milter test-queue-file6 cleanup_milter.in6c \ + cleanup_milter.ref6c test-queue-file6 ../postcat/postcat + cp test-queue-file6 test-queue-file6.tmp + chmod u+w test-queue-file6.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref6c cleanup_milter.tmp + +cleanup_milter_test7: cleanup_milter test-queue-file7 cleanup_milter.in7 \ + cleanup_milter.ref7 test-queue-file7 ../postcat/postcat + cp test-queue-file7 test-queue-file7.tmp + chmod u+w test-queue-file7.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref7 cleanup_milter.tmp + +cleanup_milter_test8: cleanup_milter test-queue-file8 cleanup_milter.in8 \ + cleanup_milter.ref8 test-queue-file8 ../postcat/postcat + cp test-queue-file8 test-queue-file8.tmp + chmod u+w test-queue-file8.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref8 cleanup_milter.tmp + +cleanup_milter_test9: cleanup_milter test-queue-file9 cleanup_milter.in9 \ + cleanup_milter.ref9 test-queue-file9 ../postcat/postcat + cp test-queue-file9 test-queue-file9.tmp + chmod u+w test-queue-file9.tmp + ./cleanup_milter /dev/null >cleanup_milter.tmp + diff cleanup_milter.ref9 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 \ diff --git a/postfix/src/cleanup/cleanup_milter.c b/postfix/src/cleanup/cleanup_milter.c index 5836159c4..da4fddb1f 100644 --- a/postfix/src/cleanup/cleanup_milter.c +++ b/postfix/src/cleanup/cleanup_milter.c @@ -401,6 +401,10 @@ static off_t cleanup_find_header(CLEANUP_STATE *state, ssize_t index, * * Thus, header insert operations are relative to the content as delivered, * that is, the content including our own Received: header. + * + * None of the above is applicable after a Milter inserts a header before + * our own Received: header. From then on, our own Received: header + * becomes just like other headers. */ #define CLEANUP_FIND_HEADER_NOTFOUND (-1) #define CLEANUP_FIND_HEADER_IOERROR (-2) @@ -460,8 +464,7 @@ static off_t cleanup_find_header(CLEANUP_STATE *state, ssize_t index, } /* The middle of a multi-record header. */ else if (last_type == REC_TYPE_CONT || IS_SPACE_TAB(STR(buf)[0])) { - /* Reset the saved PTR record. */ - ptr_offset = 0; + /* Reset the saved PTR record and update last_type. */ } /* No more message headers. */ else if ((len = is_header(STR(buf))) == 0) { @@ -469,7 +472,7 @@ static off_t cleanup_find_header(CLEANUP_STATE *state, ssize_t index, } /* This the start of a message header. */ else if (hdr_count++ < skip_headers) - continue; + /* Reset the saved PTR record and update last_type. */ ; else if ((header_label == 0 || (strncasecmp(header_label, STR(buf), len) == 0 && (IS_SPACE_TAB(STR(buf)[len]) @@ -478,6 +481,7 @@ static off_t cleanup_find_header(CLEANUP_STATE *state, ssize_t index, /* If we have a saved PTR record, it points to start of header. */ break; } + ptr_offset = 0; last_type = rec_type; } diff --git a/postfix/src/cleanup/cleanup_milter.in6a b/postfix/src/cleanup/cleanup_milter.in6a new file mode 100644 index 000000000..aec3d3aff --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in6a @@ -0,0 +1,5 @@ +open test-queue-file6.tmp + +ins_header 1 X-Virus-Scanned hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.in6b b/postfix/src/cleanup/cleanup_milter.in6b new file mode 100644 index 000000000..832a54ae0 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in6b @@ -0,0 +1,6 @@ +open test-queue-file6.tmp + +ins_header 1 X-Virus-Scanned hya +ins_header 2 Domainkey-Signature hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.in6c b/postfix/src/cleanup/cleanup_milter.in6c new file mode 100644 index 000000000..3ef53ff51 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in6c @@ -0,0 +1,7 @@ +open test-queue-file6.tmp + +ins_header 1 X-Virus-Scanned hya +ins_header 2 Domainkey-Signature hya +ins_header 2 DKIM-Signature hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.in7 b/postfix/src/cleanup/cleanup_milter.in7 new file mode 100644 index 000000000..13ff78c4f --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in7 @@ -0,0 +1,7 @@ +open test-queue-file7.tmp + +ins_header 2 X-Virus-Scanned hya +ins_header 2 Domainkey-Signature hya +ins_header 2 DKIM-Signature hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.in8 b/postfix/src/cleanup/cleanup_milter.in8 new file mode 100644 index 000000000..508b4adae --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in8 @@ -0,0 +1,7 @@ +open test-queue-file8.tmp + +ins_header 1 inserted-at-1 hya +ins_header 2 inserted-at-2 hya +ins_header 3 inserted-at-3 hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.in9 b/postfix/src/cleanup/cleanup_milter.in9 new file mode 100644 index 000000000..3bbdc3f5d --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.in9 @@ -0,0 +1,7 @@ +open test-queue-file9.tmp + +ins_header 1 inserted-at-1 hya +ins_header 3 inserted-at-3 hya +ins_header 5 inserted-at-5 hya + +close diff --git a/postfix/src/cleanup/cleanup_milter.ref6a b/postfix/src/cleanup/cleanup_milter.ref6a new file mode 100644 index 000000000..4b9e01d52 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref6a @@ -0,0 +1,27 @@ +*** ENVELOPE RECORDS test-queue-file6.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-file6.tmp *** + 181 pointer_record: 552 + 552 regular_text: X-Virus-Scanned: hya + 574 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0) + 636 pointer_record: 243 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file6.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file6.tmp *** diff --git a/postfix/src/cleanup/cleanup_milter.ref6b b/postfix/src/cleanup/cleanup_milter.ref6b new file mode 100644 index 000000000..38d7db0c2 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref6b @@ -0,0 +1,30 @@ +*** ENVELOPE RECORDS test-queue-file6.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-file6.tmp *** + 181 pointer_record: 552 + 552 regular_text: X-Virus-Scanned: hya + 574 pointer_record: 653 + 653 regular_text: Domainkey-Signature: hya + 679 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0) + 741 pointer_record: 636 + 636 pointer_record: 243 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file6.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file6.tmp *** diff --git a/postfix/src/cleanup/cleanup_milter.ref6c b/postfix/src/cleanup/cleanup_milter.ref6c new file mode 100644 index 000000000..d979e7d68 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref6c @@ -0,0 +1,32 @@ +*** ENVELOPE RECORDS test-queue-file6.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-file6.tmp *** + 181 pointer_record: 552 + 552 regular_text: X-Virus-Scanned: hya + 574 pointer_record: 758 + 758 regular_text: DKIM-Signature: hya + 779 pointer_record: 653 + 653 regular_text: Domainkey-Signature: hya + 679 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0) + 741 pointer_record: 636 + 636 pointer_record: 243 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file6.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file6.tmp *** diff --git a/postfix/src/cleanup/cleanup_milter.ref7 b/postfix/src/cleanup/cleanup_milter.ref7 new file mode 100644 index 000000000..aa1f16eac --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref7 @@ -0,0 +1,31 @@ +*** ENVELOPE RECORDS test-queue-file7.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-file7.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 pointer_record: 658 + 658 regular_text: DKIM-Signature: hya + 679 pointer_record: 615 + 615 regular_text: Domainkey-Signature: hya + 641 pointer_record: 552 + 552 regular_text: X-Virus-Scanned: hya + 574 regular_text: From: me@porcupine.org + 598 pointer_record: 323 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file7.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file7.tmp *** diff --git a/postfix/src/cleanup/cleanup_milter.ref8 b/postfix/src/cleanup/cleanup_milter.ref8 new file mode 100644 index 000000000..64ef7d1be --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref8 @@ -0,0 +1,33 @@ +*** ENVELOPE RECORDS test-queue-file8.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-file8.tmp *** + 181 pointer_record: 552 + 552 regular_text: inserted-at-1: hya + 572 pointer_record: 651 + 651 regular_text: inserted-at-2: hya + 671 pointer_record: 750 + 750 regular_text: inserted-at-3: hya + 770 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0) + 832 pointer_record: 733 + 733 pointer_record: 634 + 634 pointer_record: 243 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file8.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file8.tmp *** diff --git a/postfix/src/cleanup/cleanup_milter.ref9 b/postfix/src/cleanup/cleanup_milter.ref9 new file mode 100644 index 000000000..91cd76091 --- /dev/null +++ b/postfix/src/cleanup/cleanup_milter.ref9 @@ -0,0 +1,32 @@ +*** ENVELOPE RECORDS test-queue-file9.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-file9.tmp *** + 181 pointer_record: 552 + 552 regular_text: inserted-at-1: hya + 572 regular_text: Received: by bristle.watson.ibm.com (Postfix, from userid 0) + 634 pointer_record: 243 + 243 regular_text: id 034B229013F; Tue, 25 Jul 2006 15:37:06 -0400 (EDT) + 299 pointer_record: 651 + 651 regular_text: inserted-at-3: hya + 671 regular_text: From: me@porcupine.org + 695 pointer_record: 712 + 712 regular_text: inserted-at-5: hya + 732 pointer_record: 323 + 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 regular_text: Subject: hey! + 468 pointer_record: 0 + 485 regular_text: + 487 regular_text: text + 493 pointer_record: 0 + 510 *** HEADER EXTRACTED test-queue-file9.tmp *** + 512 original_recipient: you@porcupine.org + 531 recipient: you@porcupine.org + 550 *** MESSAGE FILE END test-queue-file9.tmp *** diff --git a/postfix/src/cleanup/test-queue-file6 b/postfix/src/cleanup/test-queue-file6 new file mode 100644 index 000000000..f5a7b0194 Binary files /dev/null and b/postfix/src/cleanup/test-queue-file6 differ diff --git a/postfix/src/cleanup/test-queue-file7 b/postfix/src/cleanup/test-queue-file7 new file mode 100644 index 000000000..f5a7b0194 Binary files /dev/null and b/postfix/src/cleanup/test-queue-file7 differ diff --git a/postfix/src/cleanup/test-queue-file8 b/postfix/src/cleanup/test-queue-file8 new file mode 100644 index 000000000..f5a7b0194 Binary files /dev/null and b/postfix/src/cleanup/test-queue-file8 differ diff --git a/postfix/src/cleanup/test-queue-file9 b/postfix/src/cleanup/test-queue-file9 new file mode 100644 index 000000000..f5a7b0194 Binary files /dev/null and b/postfix/src/cleanup/test-queue-file9 differ diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 98879f1e0..87273163e 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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 "20061217" +#define MAIL_RELEASE_DATE "20061221" #define MAIL_VERSION_NUMBER "2.4" #ifdef SNAPSHOT diff --git a/postfix/src/milter/milter8.c b/postfix/src/milter/milter8.c index f5ac7240a..2819f2c43 100644 --- a/postfix/src/milter/milter8.c +++ b/postfix/src/milter/milter8.c @@ -2097,14 +2097,14 @@ static void milter8_body(void *ptr, int rec_type, vstring_memcat(milter->body, bp, count); bp += count; todo -= count; - /* Flush body chunk buffer when full. */ + /* Flush body chunk buffer when full. See also milter8_eob(). */ if (LEN(milter->body) == MILTER_CHUNK_SIZE) { msg_ctx->resp = milter8_event(milter, SMFIC_BODY, SMFIP_NOBODY, DONT_SKIP_REPLY, msg_ctx->macros, MILTER8_DATA_BUFFER, milter->body, MILTER8_DATA_END); - if (msg_ctx->resp != 0 || milter->state != MILTER8_STAT_MESSAGE) + if (MILTER8_MESSAGE_DONE(milter, msg_ctx)) break; VSTRING_RESET(milter->body); } @@ -2129,10 +2129,30 @@ static void milter8_eob(void *ptr) return; if (msg_verbose) msg_info("%s: eob milter %s", myname, milter->m.name); + + /* + * Flush partial body chunk buffer. See also milter8_body(). + * + * XXX Sendmail 8 libmilter accepts SMFIC_EOB+data, and delivers it to the + * application as two events: SMFIC_BODY+data followed by SMFIC_EOB. This + * breaks with the PMilter 0.95 protocol re-implementation, which + * delivers the SMFIC_EOB event and ignores the data. To avoid such + * compatibility problems we separate the events in the client. With + * this, we also prepare for a future where different event types can + * have different macro lists. + */ + if (LEN(milter->body) > 0) { + msg_ctx->resp = + milter8_event(milter, SMFIC_BODY, SMFIP_NOBODY, + DONT_SKIP_REPLY, msg_ctx->macros, + MILTER8_DATA_BUFFER, milter->body, + MILTER8_DATA_END); + if (MILTER8_MESSAGE_DONE(milter, msg_ctx)) + return; + } msg_ctx->resp = milter8_event(msg_ctx->milter, SMFIC_BODYEOB, 0, DONT_SKIP_REPLY, msg_ctx->macros, - MILTER8_DATA_BUFFER, milter->body, MILTER8_DATA_END); } diff --git a/postfix/src/postqueue/postqueue.c b/postfix/src/postqueue/postqueue.c index c8fa2d870..c26f4a3fc 100644 --- a/postfix/src/postqueue/postqueue.c +++ b/postfix/src/postqueue/postqueue.c @@ -33,9 +33,13 @@ /* Warning: flushing undeliverable mail frequently will result in /* poor delivery performance of all other mail. /* .IP "\fB-i \fIqueue_id\fR" -/* Schedule immediate delivery of mail with the specified queue ID. -/* This feature uses the \fBflush\fR(8) server, and is available -/* with Postfix 2.4 and later. +/* Schedule immediate delivery of deferred mail with the +/* specified queue ID. +/* +/* This option implements the traditional \fBsendmail -qI\fR +/* command, by contacting the \fBflush\fR(8) server. +/* +/* This feature is available with Postfix version 2.4 and later. /* .IP \fB-p\fR /* Produce a traditional sendmail-style queue listing. /* This option implements the traditional \fBmailq\fR command, @@ -216,6 +220,18 @@ /* * Modes of operation. + * + * XXX To support flush by recipient domain, or for destinations that have no + * mapping to logfile, the server has to defend against resource exhaustion + * attacks. A malicious user could fork off a postqueue client that starts + * an expensive requests and then kills the client immediately; this way she + * could create a high Postfix load on the system without ever exceeding her + * own per-user process limit. To prevent this, either the server needs to + * establish frequent proof of client liveliness with challenge/response, or + * the client needs to restrict expensive requests to privileged users only. + * + * We don't have this problem with queue listings. The showq server detects + * an EPIPE error after reporting a few queue entries. */ #define PQ_MODE_DEFAULT 0 /* noop */ #define PQ_MODE_MAILQ_LIST 1 /* list mail queue */