diff --git a/postfix/HISTORY b/postfix/HISTORY index 82c867d87..1ec7f261d 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -6829,10 +6829,36 @@ Apologies for any names omitted. mail to be placed on the "hold" queue for manual inspection. Files: global/hold_message.[hc], cleanup/cleanup_message.c. +20020820 + + Bugfix: yesterday's HOLD pattern code did not update the + cleanup server's idea of the queue file name for error + recovery and for error reporting purposes, so that incomplete + or content rejected mail would not be deleted from the + queue, and so that the bouncer would not find the queue + file. + + Feature: new header/body_checks DISCARD pattern that causes + mail to be silently discarded. Files: global/cleanup_user.h, + cleanup/cleanup_message.c. + + Bugfix: the local delivery agent's mailbox duplicate delivery + eliminator was not updated when address extensions were + added to Postfix. The other local duplicate eliminators + may need revision as well. File: local/mailbox.c. + +20020821 + + Feature: HOLD and DISCARD actions in SMTPD access tables. + These requests are propagated to the cleanup daemon, + which required a bit of redesign of internal protocols. + Files: cleanup/cleanup.c pickup/pickup.c smtpd/smtpd.c + global/post_mail.c qmqpd/qmqpd.c local/forward.c. + Open problems: - Medium: should permit_mx_backup defer delivery if DNS - has some error of some kind? + Medium: should permit_mx_backup defer delivery if DNS has + some error of some kind? Low: all table lookups should consistently use internalized (unquoted) or externalized (quoted) forms as lookup keys. diff --git a/postfix/README_FILES/LDAP_README b/postfix/README_FILES/LDAP_README index 6f158d7b0..02c152b3c 100644 --- a/postfix/README_FILES/LDAP_README +++ b/postfix/README_FILES/LDAP_README @@ -15,9 +15,16 @@ BUILDING WITH LDAP SUPPORT Note: Postfix no longer supports the LDAP version 1 interface. -You need to have LDAP libraries and include files installed somewhere on -your system, and you need to configure the Postfix Makefiles -accordingly. +You need to have LDAP libraries and include files installed somewhere +on your system, and you need to configure the Postfix Makefiles +accordingly. + +For example, to build the OpenLDAP libraries for use with Postfix +(i.e. LDAP client code only), you could use the following command: + + % ./configure --without-kerberos --without-cyrus-sasl --without-tls \ + --without-threads --disable-slapd --disable-slurpd \ + --disable-debug --disable-shared If you're using the libraries from the UM distribution (http://www.umich.edu/~dirsvcs/ldap/ldap.html) or OpenLDAP diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 58ec18c3a..e8339cf50 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -12,8 +12,14 @@ snapshot release). Patches change the patchlevel and the release date. Snapshots change only the release date, unless they include the same bugfixes as a patch release. -Incompatible changes with Postfix snapshot 1.1.11-2002018 -========================================================= +Incompatible changes with Postfix snapshot 1.1.11-20020821 +========================================================== + +After switching Postfix versions you need to "postfix reload" +because internal protocols have changed. + +Incompatible changes with Postfix snapshot 1.1.11-20020818 +========================================================== The qmgr_site_hog_factor feature is gone (this would defer mail delivery for sites that occupy too much space in the active queue, diff --git a/postfix/conf/access b/postfix/conf/access index 0b1148ed0..20a13c44b 100644 --- a/postfix/conf/access +++ b/postfix/conf/access @@ -115,6 +115,17 @@ # # OK Accept the address etc. that matches the pattern. # +# HOLD Place the message on the hold queue, where it will +# sit until someone either deletes it or releases it +# for delivery. Mail that is placed on hold can be +# examined with the postcat(1) command, and can be +# destroyed or released with the postsuper(1) com- +# mand. +# +# DISCARD +# Claim successful delivery and silently discard the +# message. +# # all-numerical # An all-numerical result is treated as OK. This for- # mat is generated by address-based relay authoriza- diff --git a/postfix/conf/main.cf b/postfix/conf/main.cf index 579916cfa..1aee92cc6 100644 --- a/postfix/conf/main.cf +++ b/postfix/conf/main.cf @@ -29,14 +29,13 @@ queue_directory = /var/spool/postfix # The command_directory parameter specifies the location of all -# postXXX commands. The default value is $program_directory. +# postXXX commands. # command_directory = /usr/sbin # The daemon_directory parameter specifies the location of all Postfix -# daemon programs (i.e. programs listed in the master.cf file). The -# default value is $program_directory. This directory must be owned -# by root. +# daemon programs (i.e. programs listed in the master.cf file). This +# directory must be owned by root. # daemon_directory = /usr/libexec/postfix @@ -417,11 +416,22 @@ mail_owner = postfix # When a pattern matches, what happens next depends on the associated # action that is specified in the right-hand side of the table: # -# REJECT the entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE the header line is silently discarded. -# WARN the header is logged (not rejected) with a warning message. -# WARN text... as above, and the text is logged, too. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to the +# originator and is logged to the maillog file. +# IGNORE Silently discard the header line. +# WARN [optional text...] +# Log the message header and the optional text. This is useful +# for testing. When the pattern is OK, change the WARN into a +# REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can be +# inspected with the postcat command, and can be destroyed or +# taken off hold (i.e. delivered) with the postsuper command. +# The matched header is logged with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the message. +# The matched header is logged with the optional text. # FILTER transport:nexthop # after the message is queued, send the entire message through # a content filter. This requires different cleanup servers diff --git a/postfix/conf/master.cf b/postfix/conf/master.cf index 936c60801..2bcdadb28 100644 --- a/postfix/conf/master.cf +++ b/postfix/conf/master.cf @@ -42,7 +42,7 @@ # # Command + args: the command to be executed. The command name is # relative to the Postfix program directory (pathname is controlled by -# the program_directory configuration variable). Adding one or more +# the daemon_directory configuration variable). Adding one or more # -v options turns on verbose logging for that service; adding a -D # option enables symbolic debugging (see the debugger_command variable # in the main.cf configuration file). See individual command man pages diff --git a/postfix/conf/sample-debug.cf b/postfix/conf/sample-debug.cf index 5f850ddc7..6ac659e46 100644 --- a/postfix/conf/sample-debug.cf +++ b/postfix/conf/sample-debug.cf @@ -29,4 +29,4 @@ debug_peer_list = # debugger_command = PATH=/usr/bin:/usr/X11R6/bin - xxgdb $program_directory/$process_name $process_id & sleep 5 + xxgdb $daemon_directory/$process_name $process_id & sleep 5 diff --git a/postfix/conf/sample-filter.cf b/postfix/conf/sample-filter.cf index 7ddfc3c27..f6e7388a3 100644 --- a/postfix/conf/sample-filter.cf +++ b/postfix/conf/sample-filter.cf @@ -11,11 +11,22 @@ # When a pattern matches, what happens next depends on the associated # action that is specified in the right-hand side of the table: # -# REJECT the entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE the header line is silently discarded. -# WARN the header is logged (not rejected) with a warning message. -# WARN text... as above, and the text is logged, too. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to the +# originator and is logged to the maillog file. +# IGNORE Silently discard the header line. +# WARN [optional text...] +# Log the message header and the optional text. This is useful +# for testing. When the pattern is OK, change the WARN into a +# REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can be +# inspected with the postcat command, and can be destroyed or +# taken off hold (i.e. delivered) with the postsuper command. +# The matched header is logged with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the message. +# The matched header is logged with the optional text. # FILTER transport:nexthop # after the message is queued, the message is sent through # a content filter. This requires different cleanup servers @@ -40,11 +51,22 @@ header_checks = regexp:/etc/postfix/header_checks # depends on the associated action that is specified in the right-hand # side of the table: # -# REJECT the entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE the header line is silently discarded. -# WARN the header is logged (not rejected) with a warning message. -# WARN text... as above, and the text is logged, too. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to the +# originator and is logged to the maillog file. +# IGNORE Silently discard the body line +# WARN [optional text...] +# Log the body line and the optional text. This is useful +# for testing. When the pattern is OK, change the WARN into a +# REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can be +# inspected with the postcat command, and can be destroyed or +# taken off hold (i.e. delivered) with the postsuper command. +# The matched body line is logged with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the message. +# The matched body line is logged with the optional text. # FILTER transport:nexthop # after the message is queued, the message is sent through # a content filter. This requires different cleanup servers diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf index 8f7e2ed45..420600211 100644 --- a/postfix/conf/sample-misc.cf +++ b/postfix/conf/sample-misc.cf @@ -317,10 +317,10 @@ parent_domain_matches_subdomains = debug_peer_list,fast_flush_domains, # process_id_directory = pid -# The program_directory parameter specifies the location of Postfix +# The daemon_directory parameter specifies the location of Postfix # support programs and daemons. This directory must be owned by root. # -program_directory = /usr/libexec/postfix +daemon_directory = /usr/libexec/postfix # The queue_directory specifies the location of the Postfix queue. # This is also the root directory of Postfix daemons that run chrooted. diff --git a/postfix/conf/sample-pcre-body.cf b/postfix/conf/sample-pcre-body.cf index 6b23c9434..1d314a3be 100644 --- a/postfix/conf/sample-pcre-body.cf +++ b/postfix/conf/sample-pcre-body.cf @@ -1,4 +1,4 @@ -# +# # Sample pcre (PERL-compatible regular expression) map file for # mail body filtering. See pcre_table(5) for syntax description. # @@ -19,13 +19,26 @@ # info). # # The second field is the "replacement" string - the text -# returned by the match. +# returned by the match. # -# REJECT The entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE The line is silently discarded. -# WARN The line is logged (not rejected) with a warning. -# WARN text.... As above, and the text is logged, too. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to +# the originator and is logged to the maillog file. +# IGNORE Silently discard the body line. +# WARN [optional text...] +# Log the body line and the optional text. This is +# useful for testing. When the pattern is OK, change the +# WARN into a REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can +# be inspected with the postcat command, and can be +# destroyed or taken off hold (i.e. delivered) with the +# postsuper command. The matched body line is logged +# together with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the +# message. The matched body line is logged together +# with the optional text. # FILTER transport:nexthop # After the message is queued, send the entire # message through a content filter. This diff --git a/postfix/conf/sample-pcre-header.cf b/postfix/conf/sample-pcre-header.cf index 44bd75997..e69dda783 100644 --- a/postfix/conf/sample-pcre-header.cf +++ b/postfix/conf/sample-pcre-header.cf @@ -21,19 +21,32 @@ # The second field is the "replacement" string - the text # returned by the match. # -# REJECT The entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE The header line is silently discarded. -# WARN The header is logged (not rejected) with a warning. -# WARN text.... As above, and the text is logged, too. -# FILTER transport:nexthop -# After the message is queued, send the entire -# message through a content filter. This -# requires different cleanup servers before -# and after the filter, with header/body -# checks turned off in the second cleanup -# server. More information about content filters -# is in the Postfix FILTER_README file. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to +# the originator and is logged to the maillog file. +# IGNORE Silently ignore the message header. +# WARN [optional text...] +# Log the message header and the optional text. This is +# useful for testing. When the pattern is OK, change the +# WARN into a REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can +# be inspected with the postcat command, and can be +# destroyed or taken off hold (i.e. delivered) with the +# postsuper command. The matched header is logged +# together with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the +# message. The matched header is logged together with +# the optional text. +# FILTER transport:nexthop +# After the message is queued, send the entire +# message through a content filter. This +# requires different cleanup servers before +# and after the filter, with header/body +# checks turned off in the second cleanup +# server. More information about content filters +# is in the Postfix FILTER_README file. # # Substitution of sub-strings from the matched expression is # possible using the conventional perl syntax. The macros in the diff --git a/postfix/conf/sample-regexp-body.cf b/postfix/conf/sample-regexp-body.cf index 577428e43..69f78d38a 100644 --- a/postfix/conf/sample-regexp-body.cf +++ b/postfix/conf/sample-regexp-body.cf @@ -17,18 +17,27 @@ # terminating processing of the ruleset. # # The result is one of the following: -# REJECT The entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE The header line is silently discarded. -# WARN The header is logged (not rejected) with a warning. -# WARN text.... As above, and the text is logged, too. -# FILTER transport:nexthop -# After the message is queued, send the entire -# message through a content filter. This requires -# different cleanup servers before and after the -# filter, with header/body checks turned off in -# the second cleanup server. More information about -# content filters is in the Postfix FILTER_README file. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to the +# originator and is logged to the maillog file. +# IGNORE Silently ignore the body line. +# WARN [optional text...] +# Log the body line and the optional text. This is useful +# for testing. When the pattern is OK, change the WARN into a +# REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can be +# inspected with the postcat command, and can be destroyed or +# taken off hold (i.e. delivered) with the postsuper command. +# The matched body line is logged together with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the message. +# The matched body line is logged together with the optional text. +# FILTER transport:nexthop +# After the message is queued, send the entire message through +# a content filter. This requires different cleanup servers +# before and after the filter, with header/body checks turned +# off in the second cleanup server. # Skip over base 64 encoded blocks. This saves lots of CPU cycles. # Expressions by Liviu Daia. Amended by Victor Duchovni. diff --git a/postfix/conf/sample-regexp-header.cf b/postfix/conf/sample-regexp-header.cf index 23be2c363..9684f682b 100644 --- a/postfix/conf/sample-regexp-header.cf +++ b/postfix/conf/sample-regexp-header.cf @@ -18,18 +18,27 @@ # terminating processing of the ruleset. # # The result is one of the following: -# REJECT the entire message is rejected. -# REJECT text.... The text is sent to the originator. -# IGNORE the header line is silently discarded. -# WARN the header is logged (not rejected) with a warning. -# WARN text... As above, and the text is logged, too. -# FILTER transport:nexthop -# After the message is queued, send the entire -# message through a content filter. This requires -# different cleanup servers before and after the -# filter, with header/body checks turned off in -# the second cleanup server. More information about -# content filters is in the Postfix FILTER_README file. +# REJECT [optional text...] +# Reject the entire message. The optional text is sent to the +# originator and is logged to the maillog file. +# IGNORE Silently discard the message header. +# WARN [optional text...] +# Log the message header and the optional text. This is useful +# for testing. When the pattern is OK, change the WARN into a +# REJECT or into a DISCARD. +# HOLD [optional text...] +# Place the message on the hold queue. Mail on hold can be +# inspected with the postcat command, and can be destroyed or +# taken off hold (i.e. delivered) with the postsuper command. +# The matched header is logged together with the optional text. +# DISCARD [optional text...] +# Claim successful delivery and silently discard the message. +# The matched header is logged together with the optional text. +# FILTER transport:nexthop +# After the message is queued, send the entire message through +# a content filter. This requires different cleanup servers +# before and after the filter, with header/body checks turned +# off in the second cleanup server. /^Subject: Make Money Fast/ REJECT /^To: friend@public.com/ REJECT diff --git a/postfix/html/access.5.html b/postfix/html/access.5.html index 2e1400596..487913402 100644 --- a/postfix/html/access.5.html +++ b/postfix/html/access.5.html @@ -116,6 +116,17 @@ ACCESS(5) ACCESS(5) OK Accept the address etc. that matches the pattern. + HOLD Place the message on the hold queue, where it will + sit until someone either deletes it or releases it + for delivery. Mail that is placed on hold can be + examined with the postcat(1) command, and can be + destroyed or released with the postsuper(1) com- + mand. + + DISCARD + Claim successful delivery and silently discard the + message. + all-numerical An all-numerical result is treated as OK. This for- mat is generated by address-based relay authoriza- diff --git a/postfix/html/uce.html b/postfix/html/uce.html index 5532378ec..1dd3b0025 100644 --- a/postfix/html/uce.html +++ b/postfix/html/uce.html @@ -127,21 +127,38 @@ matches a table, the action depends on the lookup result:
+ +
+ +
+ +
+ +
+ +
+ +
diff --git a/postfix/man/man5/access.5 b/postfix/man/man5/access.5
index 43846a08b..72b7d1e1e 100644
--- a/postfix/man/man5/access.5
+++ b/postfix/man/man5/access.5
@@ -115,6 +115,14 @@ Reject the address etc. that matches the pattern. A generic
error response message is generated.
.IP \fBOK\fR
Accept the address etc. that matches the pattern.
+.IP \fBHOLD\fR
+Place the message on the \fBhold\fR queue, where it will sit
+until someone either deletes it or releases it for delivery.
+Mail that is placed on hold can be examined with the
+\fBpostcat\fR(1) command, and can be destroyed or released with
+the \fBpostsuper\fR(1) command.
+.IP \fBDISCARD\fR
+Claim successful delivery and silently discard the message.
.IP \fIall-numerical\fR
An all-numerical result is treated as OK. This format is
generated by address-based relay authorization schemes.
diff --git a/postfix/proto/access b/postfix/proto/access
index cdb445966..b0564d06c 100644
--- a/postfix/proto/access
+++ b/postfix/proto/access
@@ -59,7 +59,7 @@
# Note: lookup of the null sender address is not possible with
# some types of lookup table. By default, Postfix uses \fB<>\fR
# as the lookup key for such addresses. The value is specified with
-# the workaround is to specify \fBsmtpd_null_access_lookup_key\fR
+# the workaround is to specify \fBsmtpd_null_access_lookup_key\fR
# parameter in the Postfix \fBmain.cf\fR file.
# ADDRESS EXTENSION
# .fi
@@ -102,6 +102,14 @@
# .IP \fIall-numerical\fR
# An all-numerical result is treated as OK. This format is
# generated by address-based relay authorization schemes.
+# .IP \fBHOLD\fR
+# Place the message on the \fBhold\fR queue, where it will sit
+# until someone either deletes it or releases it for delivery.
+# Mail that is placed on hold can be examined with the
+# \fBpostcat\fR(1) command, and can be destroyed or released with
+# the \fBpostsuper\fR(1) command.
+# .IP \fBDISCARD\fR
+# Claim successful delivery and silently discard the message.
# .IP \fIrestriction...\fR
# Apply the named UCE restriction(s) (\fBpermit\fR, \fBreject\fR,
# \fBreject_unauth_destination\fR, and so on).
diff --git a/postfix/src/bounce/bounce.c b/postfix/src/bounce/bounce.c
index f176e222f..d607e46d6 100644
--- a/postfix/src/bounce/bounce.c
+++ b/postfix/src/bounce/bounce.c
@@ -145,7 +145,7 @@ static int bounce_append_proto(char *service_name, VSTREAM *client)
* Read the and validate the client request.
*/
if (mail_command_server(client,
- ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &flags,
+ ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, &flags,
ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id,
ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient,
ATTR_TYPE_STR, MAIL_ATTR_WHY, why,
@@ -185,7 +185,7 @@ static int bounce_notify_proto(char *service_name, VSTREAM *client, int flush)
* Read and validate the client request.
*/
if (mail_command_server(client,
- ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &flags,
+ ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, &flags,
ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue_name,
ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id,
ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding,
@@ -233,7 +233,7 @@ static int bounce_verp_proto(char *service_name, VSTREAM *client, int flush)
* Read and validate the client request.
*/
if (mail_command_server(client,
- ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &flags,
+ ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, &flags,
ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue_name,
ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id,
ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding,
@@ -293,7 +293,7 @@ static int bounce_one_proto(char *service_name, VSTREAM *client)
* Read and validate the client request.
*/
if (mail_command_server(client,
- ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &unused_flags,
+ ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, &unused_flags,
ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue_name,
ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id,
ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding,
diff --git a/postfix/src/cleanup/Makefile.in b/postfix/src/cleanup/Makefile.in
index 7a7ab688d..b5fc13992 100644
--- a/postfix/src/cleanup/Makefile.in
+++ b/postfix/src/cleanup/Makefile.in
@@ -125,6 +125,7 @@ cleanup_api.o: ../../include/attr.h
cleanup_api.o: ../../include/bounce.h
cleanup_api.o: ../../include/mail_params.h
cleanup_api.o: ../../include/mail_stream.h
+cleanup_api.o: ../../include/hold_message.h
cleanup_api.o: cleanup.h
cleanup_api.o: ../../include/argv.h
cleanup_api.o: ../../include/nvtable.h
@@ -321,7 +322,6 @@ cleanup_message.o: ../../include/iostuff.h
cleanup_message.o: ../../include/attr.h
cleanup_message.o: ../../include/mime_state.h
cleanup_message.o: ../../include/lex_822.h
-cleanup_message.o: ../../include/hold_message.h
cleanup_message.o: cleanup.h
cleanup_message.o: ../../include/maps.h
cleanup_message.o: ../../include/dict.h
diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c
index a9bf352f2..b07b3319a 100644
--- a/postfix/src/cleanup/cleanup.c
+++ b/postfix/src/cleanup/cleanup.c
@@ -226,20 +226,11 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv)
state = cleanup_open();
/*
- * Send the queue id to the client. Read client processing options. If we
- * can't read the client processing options we can pretty much forget
- * about the whole operation.
+ * Send the queue id to the client.
*/
attr_print(src, ATTR_FLAG_NONE,
ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, state->queue_id,
ATTR_TYPE_END);
- if (attr_scan(src, ATTR_FLAG_STRICT,
- ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &flags,
- ATTR_TYPE_END) != 1) {
- state->errs |= CLEANUP_STAT_BAD;
- flags = 0;
- }
- cleanup_control(state, flags);
/*
* XXX Rely on the front-end programs to enforce record size limits.
@@ -263,7 +254,8 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv)
* our status report.
*/
if (CLEANUP_OUT_OK(state) == 0 && type > 0) {
- if ((state->errs & CLEANUP_STAT_CONT) == 0)
+ if ((state->errs & CLEANUP_STAT_CONT) == 0
+ && (state->flags & CLEANUP_FLAG_DISCARD) == 0)
msg_warn("%s: skipping further client input", state->queue_id);
while (type != REC_TYPE_END
&& (type = rec_get(src, buf, 0)) > 0)
diff --git a/postfix/src/cleanup/cleanup.h b/postfix/src/cleanup/cleanup.h
index c795b350f..94ca492bb 100644
--- a/postfix/src/cleanup/cleanup.h
+++ b/postfix/src/cleanup/cleanup.h
@@ -133,7 +133,8 @@ extern void PRINTFLIKE(3, 4) cleanup_out_format(CLEANUP_STATE *, int, const char
#define CLEANUP_OUT_BUF(s, t, b) \
cleanup_out((s), (t), vstring_str((b)), VSTRING_LEN((b)))
-#define CLEANUP_OUT_OK(s) (((s)->errs & (s)->err_mask) == 0)
+#define CLEANUP_OUT_OK(s) \
+ (!((s)->errs & (s)->err_mask) && !((s)->flags & CLEANUP_FLAG_DISCARD))
/*
* cleanup_envelope.c
diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c
index 9b6e39b60..2644aa8dd 100644
--- a/postfix/src/cleanup/cleanup_api.c
+++ b/postfix/src/cleanup/cleanup_api.c
@@ -35,8 +35,9 @@
/* queue_id result structure member.
/*
/* cleanup_control() processes per-message flags specified by the caller.
-/* These flags control the handling of data errors, and must be set
-/* before processing the first message record.
+/* These flags control the storage of mail and the handling of errors.
+/* It is an error to any change error handling flags in the middle of
+/* a message.
/* .IP CLEANUP_FLAG_BOUNCE
/* The cleanup server is responsible for returning undeliverable
/* mail (too many hops, message too large) to the sender.
@@ -98,6 +99,7 @@
#include