From: Wietse Venema Date: Thu, 22 Aug 2002 05:00:00 +0000 (-0500) Subject: postfix-1.1.11-20020822 X-Git-Tag: v2.0.0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5958ff9688ab038c0d2d5f97a5bdf7060f1c3fc6;p=thirdparty%2Fpostfix.git postfix-1.1.11-20020822 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index 1ec7f261d..f901f057f 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -6811,7 +6811,7 @@ Apologies for any names omitted. 20020816 - Cleanup: "postqueue -f" now also trigger delivery of mail + Cleanup: "postqueue -f" now also triggers delivery of mail in the maildrop directory. This is needed when the master does not frequently wake up the pickup service. Files: global/mail_flush.c, postqueue/postqueue.c. @@ -6838,28 +6838,45 @@ Apologies for any names omitted. queue, and so that the bouncer would not find the queue file. + Bugfix: the #ifdef that detects too old LDAP libraries was + in the wrong place. Victor Duchovni. File: util/dict_ldap.c. + Feature: new header/body_checks DISCARD pattern that causes mail to be silently discarded. Files: global/cleanup_user.h, - cleanup/cleanup_message.c. + cleanup/cleanup_message.c, cleanup/cleanup_api.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. + eliminator was not updated in the days that address extensions + were added to Postfix. The other local duplicate eliminators + probably 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. + These requests are propagated to the cleanup daemon. + Files: cleanup/cleanup_envelope.c smtpd/smtpd_check.c. + + Cleanup: eliminate unnecessary references to the obsolete + program_directory configuration parameter (but keep the + parameter so as to not break existing installations). + Matthias Andree, many little changes in documentation. + +20020822 + + Bit Rot: OpenLDAP incompatible change with URL parsing. + Patches by Will Day, Georgia Tech, and Carsten Hoeger, + SUSE. File: util/dict_ldap.c. Open problems: + Low: smtpd should log queue ID with reject/warn/hold/discard + actions. + Medium: should permit_mx_backup defer delivery if DNS has some error of some kind? + Low: revise other local delivery agent duplicate filters. + Low: all table lookups should consistently use internalized (unquoted) or externalized (quoted) forms as lookup keys. smtpd, qmgr, local, etc. use unquoted address forms as diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index e8339cf50..2a2f1907e 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -12,13 +12,7 @@ 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-20020821 -========================================================== - -After switching Postfix versions you need to "postfix reload" -because internal protocols have changed. - -Incompatible changes with Postfix snapshot 1.1.11-20020818 +Incompatible changes with Postfix snapshot 1.1.11-20020819 ========================================================== The qmgr_site_hog_factor feature is gone (this would defer mail diff --git a/postfix/conf/access b/postfix/conf/access index 20a13c44b..45cd464aa 100644 --- a/postfix/conf/access +++ b/postfix/conf/access @@ -115,6 +115,11 @@ # # OK Accept the address etc. that matches the pattern. # +# all-numerical +# An all-numerical result is treated as OK. This for- +# mat is generated by address-based relay authoriza- +# tion schemes. +# # 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 @@ -126,11 +131,6 @@ # 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- -# tion schemes. -# # restriction... # Apply the named UCE restriction(s) (permit, reject, # reject_unauth_destination, and so on). diff --git a/postfix/html/access.5.html b/postfix/html/access.5.html index 487913402..ff70e7979 100644 --- a/postfix/html/access.5.html +++ b/postfix/html/access.5.html @@ -116,6 +116,11 @@ ACCESS(5) ACCESS(5) OK Accept the address etc. that matches the pattern. + all-numerical + An all-numerical result is treated as OK. This for- + mat is generated by address-based relay authoriza- + tion schemes. + 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 @@ -127,11 +132,6 @@ ACCESS(5) ACCESS(5) 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- - tion schemes. - restriction... Apply the named UCE restriction(s) (permit, reject, reject_unauth_destination, and so on). diff --git a/postfix/html/sendmail.1.html b/postfix/html/sendmail.1.html index fafcf5513..0644b175b 100644 --- a/postfix/html/sendmail.1.html +++ b/postfix/html/sendmail.1.html @@ -291,12 +291,10 @@ SENDMAIL(1) SENDMAIL(1) processes. command_directory - Directory with Postfix support commands (default: - $program_directory). + Directory with Postfix support commands. daemon_directory - Directory with Postfix daemon programs (default: - $program_directory). + Directory with Postfix daemon programs. queue_directory Top-level directory of the Postfix queue. This is diff --git a/postfix/html/smtpd.8.html b/postfix/html/smtpd.8.html index c7f2a0e69..96dbad7a1 100644 --- a/postfix/html/smtpd.8.html +++ b/postfix/html/smtpd.8.html @@ -120,75 +120,74 @@ SMTPD(8) SMTPD(8) the system. command_directory - Location of Postfix support commands (default: - $program_directory). + Location of Postfix support commands. debug_peer_level - Increment in verbose logging level when a remote + Increment in verbose logging level when a remote host matches a pattern in the debug_peer_list parameter. debug_peer_list - List of domain or network patterns. When a remote - host matches a pattern, increase the verbose log- - ging level by the amount specified in the + List of domain or network patterns. When a remote + host matches a pattern, increase the verbose log- + ging level by the amount specified in the debug_peer_level parameter. default_verp_delimiters The default VERP delimiter characters that are used - when the XVERP command is specified without + when the XVERP command is specified without explicit delimiters. error_notice_recipient - Recipient of protocol/policy/resource/software + Recipient of protocol/policy/resource/software error notices. hopcount_limit Limit the number of Received: message headers. local_recipient_maps - List of maps with user names that are local to + List of maps with user names that are local to $myorigin or $inet_interfaces. If this parameter is - defined, then the SMTP server rejects mail for + defined, then the SMTP server rejects mail for unknown local users. notify_classes List of error classes. Of special interest are: - policy When a client violates any policy, mail a + policy When a client violates any policy, mail a transcript of the entire SMTP session to the postmaster. protocol - When a client violates the SMTP protocol or + When a client violates the SMTP protocol or issues an unimplemented command, mail a transcript of the entire SMTP session to the postmaster. smtpd_banner - Text that follows the 220 status code in the SMTP + Text that follows the 220 status code in the SMTP greeting banner. smtpd_recipient_limit - Restrict the number of recipients that the SMTP + Restrict the number of recipients that the SMTP server accepts per message delivery. smtpd_timeout - Limit the time to send a server response and to + Limit the time to send a server response and to receive a client request. soft_bounce - Change hard (5xx) reject responses into soft (4xx) - reject responses. This can be useful for testing + Change hard (5xx) reject responses into soft (4xx) + reject responses. This can be useful for testing purposes. verp_delimiter_filter - The characters that Postfix accepts as VERP delim- + The characters that Postfix accepts as VERP delim- iter characters. Resource controls line_length_limit - Limit the amount of memory in bytes used for the + Limit the amount of memory in bytes used for the handling of partial input lines. message_size_limit @@ -196,8 +195,8 @@ SMTPD(8) SMTPD(8) ing on-disk storage for envelope information. queue_minfree - Minimal amount of free space in bytes in the queue - file system for the SMTP server to accept any mail + Minimal amount of free space in bytes in the queue + file system for the SMTP server to accept any mail at all. smtpd_history_flush_threshold @@ -212,23 +211,23 @@ SMTPD(8) SMTPD(8) smtpd_soft_error_limit When an SMTP client has made this number of errors, - wait error_count seconds before responding to any + wait error_count seconds before responding to any client request. smtpd_hard_error_limit - Disconnect after a client has made this number of + Disconnect after a client has made this number of errors. smtpd_junk_command_limit Limit the number of times a client can issue a junk - command such as NOOP, VRFY, ETRN or RSET in one - SMTP session before it is penalized with tarpit + command such as NOOP, VRFY, ETRN or RSET in one + SMTP session before it is penalized with tarpit delays. UCE control restrictions parent_domain_matches_subdomains - List of Postfix features that use domain.tld pat- - terns to match sub.domain.tld (as opposed to + List of Postfix features that use domain.tld pat- + terns to match sub.domain.tld (as opposed to requiring .domain.tld patterns). smtpd_client_restrictions @@ -236,19 +235,19 @@ SMTPD(8) SMTPD(8) tem. smtpd_helo_required - Require that clients introduce themselves at the + Require that clients introduce themselves at the beginning of an SMTP session. smtpd_helo_restrictions - Restrict what client hostnames are allowed in HELO + Restrict what client hostnames are allowed in HELO and EHLO commands. smtpd_sender_restrictions - Restrict what sender addresses are allowed in MAIL + Restrict what sender addresses are allowed in MAIL FROM commands. smtpd_recipient_restrictions - Restrict what recipient addresses are allowed in + Restrict what recipient addresses are allowed in RCPT TO commands. smtpd_etrn_restrictions @@ -256,71 +255,71 @@ SMTPD(8) SMTPD(8) mands, and what clients may issue ETRN commands. allow_untrusted_routing - Allow untrusted clients to specify addresses with - sender-specified routing. Enabling this opens up - nasty relay loopholes involving trusted backup MX + Allow untrusted clients to specify addresses with + sender-specified routing. Enabling this opens up + nasty relay loopholes involving trusted backup MX hosts. smtpd_restriction_classes - Declares the name of zero or more parameters that - contain a list of UCE restrictions. The names of - these parameters can then be used instead of the + Declares the name of zero or more parameters that + contain a list of UCE restrictions. The names of + these parameters can then be used instead of the restriction lists that they represent. smtpd_null_access_lookup_key - The lookup key to be used in SMTPD access tables - instead of the null sender address. A null sender + The lookup key to be used in SMTPD access tables + instead of the null sender address. A null sender address cannot be looked up. maps_rbl_domains - List of DNS domains that publish the addresses of + List of DNS domains that publish the addresses of blacklisted hosts. permit_mx_backup_networks - Only domains whose primary MX hosts match the - listed networks are eligible for the per- + Only domains whose primary MX hosts match the + listed networks are eligible for the per- mit_mx_backup feature. relay_domains - Restrict what domains or networks this mail system + Restrict what domains or networks this mail system will relay mail from or to. UCE control responses access_map_reject_code - Server response when a client violates an access + Server response when a client violates an access database restriction. defer_code - Server response when a client request is rejected + Server response when a client request is rejected by the defer restriction. invalid_hostname_reject_code - Server response when a client violates the + Server response when a client violates the reject_invalid_hostname restriction. maps_rbl_reject_code - Server response when a client violates the + Server response when a client violates the maps_rbl_domains restriction. reject_code - Response code when the client matches a reject + Response code when the client matches a reject restriction. relay_domains_reject_code - Server response when a client attempts to violate + Server response when a client attempts to violate the mail relay policy. unknown_address_reject_code - Server response when a client violates the + Server response when a client violates the reject_unknown_address restriction. unknown_client_reject_code - Server response when a client without address to - name mapping violates the reject_unknown_clients + Server response when a client without address to + name mapping violates the reject_unknown_clients restriction. unknown_hostname_reject_code - Server response when a client violates the + Server response when a client violates the reject_unknown_hostname restriction. SEE ALSO @@ -329,7 +328,7 @@ SMTPD(8) SMTPD(8) syslogd(8) system logging LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) diff --git a/postfix/man/man1/sendmail.1 b/postfix/man/man1/sendmail.1 index bcf13ba80..6294b3f0b 100644 --- a/postfix/man/man1/sendmail.1 +++ b/postfix/man/man1/sendmail.1 @@ -246,11 +246,9 @@ Limit the number of \fBReceived:\fR message headers. .IP \fBmail_owner\fR The owner of the mail queue and of most Postfix processes. .IP \fBcommand_directory\fR -Directory with Postfix support commands (default: -\fB$program_directory\fR). +Directory with Postfix support commands. .IP \fBdaemon_directory\fR -Directory with Postfix daemon programs (default: -\fB$program_directory\fR). +Directory with Postfix daemon programs. .IP \fBqueue_directory\fR Top-level directory of the Postfix queue. This is also the root directory of Postfix daemons that run chrooted. diff --git a/postfix/man/man5/access.5 b/postfix/man/man5/access.5 index 72b7d1e1e..c1f3161c4 100644 --- a/postfix/man/man5/access.5 +++ b/postfix/man/man5/access.5 @@ -115,6 +115,9 @@ 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 \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. @@ -123,9 +126,6 @@ Mail that is placed on hold can be examined with the 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. .IP \fIrestriction...\fR Apply the named UCE restriction(s) (\fBpermit\fR, \fBreject\fR, \fBreject_unauth_destination\fR, and so on). diff --git a/postfix/man/man8/smtpd.8 b/postfix/man/man8/smtpd.8 index be3c719c3..6b02a0e3b 100644 --- a/postfix/man/man8/smtpd.8 +++ b/postfix/man/man8/smtpd.8 @@ -117,8 +117,7 @@ anti-spoofing restriction. .IP \fBalways_bcc\fR Address to send a copy of each message that enters the system. .IP \fBcommand_directory\fR -Location of Postfix support commands (default: -\fB$program_directory\fR). +Location of Postfix support commands. .IP \fBdebug_peer_level\fR Increment in verbose logging level when a remote host matches a pattern in the \fBdebug_peer_list\fR parameter. diff --git a/postfix/src/bounce/bounce.c b/postfix/src/bounce/bounce.c index d607e46d6..f176e222f 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_BFLAGS, &flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &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_BFLAGS, &flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &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_BFLAGS, &flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &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_BFLAGS, &unused_flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &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/cleanup.c b/postfix/src/cleanup/cleanup.c index b07b3319a..bde248749 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -226,11 +226,20 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv) state = cleanup_open(); /* - * Send the queue id to the client. + * 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. */ 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. diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c index 2644aa8dd..a4261c0fa 100644 --- a/postfix/src/cleanup/cleanup_api.c +++ b/postfix/src/cleanup/cleanup_api.c @@ -35,9 +35,8 @@ /* queue_id result structure member. /* /* cleanup_control() processes per-message flags specified by the caller. -/* 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. +/* These flags control the handling of data errors, and must be set +/* before processing the first message record. /* .IP CLEANUP_FLAG_BOUNCE /* The cleanup server is responsible for returning undeliverable /* mail (too many hops, message too large) to the sender. @@ -170,8 +169,6 @@ void cleanup_control(CLEANUP_STATE *state, int flags) * definition. */ if ((state->flags = flags) & CLEANUP_FLAG_BOUNCE) { - if (state->err_mask && state->err_mask != CLEANUP_STAT_MASK_INCOMPLETE) - msg_fatal("can't set CLEANUP_FLAG_BOUNCE after initializations"); state->err_mask = CLEANUP_STAT_MASK_INCOMPLETE; } else { state->err_mask = ~CLEANUP_STAT_MASK_EXTRACT_RCPT; @@ -279,6 +276,7 @@ int cleanup_flush(CLEANUP_STATE *state) if (REMOVE(cleanup_path)) msg_warn("remove %s: %m", cleanup_path); } + /* * Make sure that our queue file will not be deleted by the error handler * AFTER we have taken responsibility for delivery. Better to deliver diff --git a/postfix/src/cleanup/cleanup_envelope.c b/postfix/src/cleanup/cleanup_envelope.c index 96dedfe4f..3d0c2019e 100644 --- a/postfix/src/cleanup/cleanup_envelope.c +++ b/postfix/src/cleanup/cleanup_envelope.c @@ -109,6 +109,7 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf, char *attr_name; char *attr_value; const char *error_text; + int extra_flags; if (type == REC_TYPE_MESG) { if (state->sender == 0 || state->time == 0) { @@ -125,6 +126,14 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf, } return; } + if (type == REC_TYPE_FLGS) { + extra_flags = atol(buf); + if (extra_flags & ~CLEANUP_FLAG_MASK_EXTRA) + msg_warn("%s: bad extra flags: 0x%x", state->queue_id, extra_flags); + else + state->flags |= extra_flags; + return; + } if (strchr(REC_TYPE_ENVELOPE, type) == 0) { msg_warn("%s: unexpected record type %d in envelope", state->queue_id, type); @@ -217,13 +226,6 @@ static void cleanup_envelope_process(CLEANUP_STATE *state, int type, char *buf, return; } nvtable_update(state->attr, attr_name, attr_value); - } else if (type == REC_TYPE_FLGS) { - - /* - * For safety's sake, allow setting flags only. Even this sucks when - * people set the CLEANUP_FLAG_BOUNCE flag too late in the game. - */ - cleanup_control(state, state->flags | atol(buf)); } else { cleanup_out(state, type, buf, len); } diff --git a/postfix/src/cleanup/cleanup_message.c b/postfix/src/cleanup/cleanup_message.c index ad68ee05f..e1c9e5106 100644 --- a/postfix/src/cleanup/cleanup_message.c +++ b/postfix/src/cleanup/cleanup_message.c @@ -281,6 +281,7 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, state->reason = mystrdup(*optional_text ? optional_text : cleanup_strerror(CLEANUP_STAT_CONT)); state->errs |= CLEANUP_STAT_CONT; + state->flags &= ~CLEANUP_FLAG_FILTER; if ((origin = nvtable_find(state->attr, MAIL_ATTR_ORIGIN)) == 0) origin = MAIL_ATTR_ORG_NONE; msg_info("%s: reject: %s %.200s from %s; from=<%s> to=<%s>: %s", @@ -314,6 +315,7 @@ static int cleanup_act(CLEANUP_STATE *state, char *context, const char *buf, *optional_text ? ": " : "", *optional_text ? optional_text : ""); state->flags |= CLEANUP_FLAG_DISCARD; + state->flags &= ~CLEANUP_FLAG_FILTER; return (CLEANUP_ACT_KEEP); } if (STREQUAL(value, "HOLD", command_len)) { diff --git a/postfix/src/global/abounce.c b/postfix/src/global/abounce.c index 44ff81d65..3bb158889 100644 --- a/postfix/src/global/abounce.c +++ b/postfix/src/global/abounce.c @@ -211,7 +211,7 @@ static void abounce_request_verp(const char *class, const char *service, if (attr_print(ap->fp, ATTR_FLAG_NONE, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, command, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding, @@ -273,7 +273,7 @@ static void abounce_request(const char *class, const char *service, if (attr_print(ap->fp, ATTR_FLAG_NONE, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, command, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding, diff --git a/postfix/src/global/bounce.c b/postfix/src/global/bounce.c index bcd4b91fb..14b74f84b 100644 --- a/postfix/src/global/bounce.c +++ b/postfix/src/global/bounce.c @@ -182,7 +182,7 @@ int vbounce_append(int flags, const char *id, const char *recipient, if (mail_command_client(MAIL_CLASS_PRIVATE, var_soft_bounce ? var_defer_service : var_bounce_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), @@ -216,7 +216,7 @@ int bounce_flush(int flags, const char *queue, const char *id, return (-1); if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_FLUSH, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding, @@ -271,7 +271,7 @@ int vbounce_one(int flags, const char *queue, const char *id, vstring_vsprintf(why, fmt, ap); if (mail_command_client(MAIL_CLASS_PRIVATE, var_bounce_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_ONE, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding, diff --git a/postfix/src/global/cleanup_user.h b/postfix/src/global/cleanup_user.h index 86471854a..44a4a506a 100644 --- a/postfix/src/global/cleanup_user.h +++ b/postfix/src/global/cleanup_user.h @@ -18,7 +18,14 @@ #define CLEANUP_FLAG_BOUNCE (1<<0) /* Bounce bad messages */ #define CLEANUP_FLAG_FILTER (1<<1) /* Enable content filter */ #define CLEANUP_FLAG_HOLD (1<<2) /* Place message on hold */ -#define CLEANUP_FLAG_DISCARD (1<<3) /* Discard message */ +#define CLEANUP_FLAG_DISCARD (1<<3) /* Discard message silently */ + + /* + * These are set on the fly while processing SMTP envelopes or message + * content. + */ +#define CLEANUP_FLAG_MASK_EXTRA \ + (CLEANUP_FLAG_HOLD | CLEANUP_FLAG_DISCARD) /* * Diagnostics. diff --git a/postfix/src/global/defer.c b/postfix/src/global/defer.c index 8c6544aeb..862f3a6fd 100644 --- a/postfix/src/global/defer.c +++ b/postfix/src/global/defer.c @@ -151,7 +151,7 @@ int vdefer_append(int flags, const char *id, const char *recipient, vstring_vsprintf(why, fmt, ap); if (mail_command_client(MAIL_CLASS_PRIVATE, var_defer_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_APPEND, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_RECIP, recipient, ATTR_TYPE_STR, MAIL_ATTR_WHY, vstring_str(why), @@ -185,7 +185,7 @@ int defer_flush(int flags, const char *queue, const char *id, { if (mail_command_client(MAIL_CLASS_PRIVATE, var_defer_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_FLUSH, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_ENCODING, encoding, @@ -205,7 +205,7 @@ int defer_warn(int flags, const char *queue, const char *id, { if (mail_command_client(MAIL_CLASS_PRIVATE, var_defer_service, ATTR_TYPE_NUM, MAIL_ATTR_NREQ, BOUNCE_CMD_WARN, - ATTR_TYPE_NUM, MAIL_ATTR_BFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, ATTR_TYPE_STR, MAIL_ATTR_SENDER, sender, diff --git a/postfix/src/global/deliver_pass.c b/postfix/src/global/deliver_pass.c index 300665df4..d2492292f 100644 --- a/postfix/src/global/deliver_pass.c +++ b/postfix/src/global/deliver_pass.c @@ -94,7 +94,7 @@ static int deliver_pass_send_request(VSTREAM *stream, DELIVER_REQUEST *request, int stat; attr_print(stream, ATTR_FLAG_NONE, - ATTR_TYPE_NUM, MAIL_ATTR_DFLAGS, request->flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, request->flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, request->queue_name, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, request->queue_id, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, request->data_offset, diff --git a/postfix/src/global/deliver_request.c b/postfix/src/global/deliver_request.c index bb44526bc..75dd3c61b 100644 --- a/postfix/src/global/deliver_request.c +++ b/postfix/src/global/deliver_request.c @@ -196,7 +196,7 @@ static int deliver_request_get(VSTREAM *stream, DELIVER_REQUEST *request) * the conversation when they send bad information. */ if (attr_scan(stream, ATTR_FLAG_STRICT | ATTR_FLAG_MORE, - ATTR_TYPE_NUM, MAIL_ATTR_DFLAGS, &request->flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &request->flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue_name, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, &request->data_offset, diff --git a/postfix/src/global/mail_proto.h b/postfix/src/global/mail_proto.h index 92b9e67b7..bb4e5caef 100644 --- a/postfix/src/global/mail_proto.h +++ b/postfix/src/global/mail_proto.h @@ -80,9 +80,7 @@ extern char *mail_pathname(const char *, const char *); #define MAIL_ATTR_NREQ "nrequest" #define MAIL_ATTR_STATUS "status" -#define MAIL_ATTR_BFLAGS "bounce_flags" -#define MAIL_ATTR_DFLAGS "delivery_flags" -#define MAIL_ATTR_RFLAGS "resolve_flags" +#define MAIL_ATTR_FLAGS "flags" #define MAIL_ATTR_QUEUE "queue_name" #define MAIL_ATTR_QUEUEID "queue_id" #define MAIL_ATTR_SENDER "sender" diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 3bbc2d47f..91c70bfb7 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -20,7 +20,7 @@ * Patches change the patchlevel and the release date. Snapshots change the * release date only, unless they include the same bugfix as a patch release. */ -#define MAIL_RELEASE_DATE "20020821" +#define MAIL_RELEASE_DATE "20020822" #define VAR_MAIL_VERSION "mail_version" #define DEF_MAIL_VERSION "1.1.11-" MAIL_RELEASE_DATE diff --git a/postfix/src/global/post_mail.c b/postfix/src/global/post_mail.c index 5ae9e571f..02e3faf0e 100644 --- a/postfix/src/global/post_mail.c +++ b/postfix/src/global/post_mail.c @@ -141,14 +141,16 @@ static void post_mail_init(VSTREAM *stream, const char *sender, */ if (attr_scan(stream, ATTR_FLAG_STRICT, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, id, - ATTR_TYPE_END) != 1) + ATTR_TYPE_END) != 1 + || attr_print(stream, ATTR_FLAG_NONE, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, + ATTR_TYPE_END) != 0) msg_fatal("unable to contact the %s service", var_cleanup_service); /* * Generate a minimal envelope section. The cleanup service will add a * size record. */ - rec_fprintf(stream, REC_TYPE_FLGS, "%d", flags); rec_fprintf(stream, REC_TYPE_TIME, "%ld", (long) now); rec_fprintf(stream, REC_TYPE_ATTR, "%s=%s", MAIL_ATTR_ORIGIN, MAIL_ATTR_ORG_LOCAL); diff --git a/postfix/src/global/rec_type.h b/postfix/src/global/rec_type.h index 82392eabf..a14656915 100644 --- a/postfix/src/global/rec_type.h +++ b/postfix/src/global/rec_type.h @@ -36,7 +36,8 @@ #define REC_TYPE_ORCP 'O' /* original recipient, optional */ #define REC_TYPE_WARN 'W' /* warning message time */ #define REC_TYPE_ATTR 'A' /* named attribute for extensions */ -#define REC_TYPE_FLGS 'f' /* set processing flags */ + +#define REC_TYPE_FLGS 'f' /* cleanup processing flags */ #define REC_TYPE_MESG 'M' /* start message records */ @@ -63,7 +64,7 @@ * allow for the presence of A records in the extracted segment, because it * can be requested to re-process already queued mail with `postsuper -r'. */ -#define REC_TYPE_ENVELOPE "MCTFILSDROWVAf" +#define REC_TYPE_ENVELOPE "MCTFILSDROWVA" #define REC_TYPE_CONTENT "XLN" #define REC_TYPE_EXTRACT "EDROPreAFI" diff --git a/postfix/src/global/resolve_clnt.c b/postfix/src/global/resolve_clnt.c index bd9a93144..c8e6ccca9 100644 --- a/postfix/src/global/resolve_clnt.c +++ b/postfix/src/global/resolve_clnt.c @@ -168,7 +168,7 @@ void resolve_clnt_query(const char *addr, RESOLVE_REPLY *reply) ATTR_TYPE_STR, MAIL_ATTR_NEXTHOP, reply->nexthop, ATTR_TYPE_STR, MAIL_ATTR_RECIP, reply->recipient, - ATTR_TYPE_NUM, MAIL_ATTR_RFLAGS, &reply->flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &reply->flags, ATTR_TYPE_END) != 4) { if (msg_verbose || (errno != EPIPE && errno != ENOENT)) msg_warn("%s: bad read: %m", myname); diff --git a/postfix/src/local/forward.c b/postfix/src/local/forward.c index f865e10c5..a15cc5592 100644 --- a/postfix/src/local/forward.c +++ b/postfix/src/local/forward.c @@ -139,12 +139,14 @@ static FORWARD_INFO *forward_open(char *sender) info->cleanup = cleanup; info->queue_id = mystrdup(vstring_str(buffer)); info->posting_time = time((time_t *) 0); + attr_print(cleanup, ATTR_FLAG_NONE, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, CLEANUP_FLAG_BOUNCE, + ATTR_TYPE_END); /* * Send initial message envelope information. For bounces, set the * designated sender: mailing list owner, posting user, whatever. */ - rec_fprintf(cleanup, REC_TYPE_FLGS, "%d", CLEANUP_FLAG_BOUNCE); rec_fprintf(cleanup, REC_TYPE_TIME, "%ld", (long) info->posting_time); rec_fputs(cleanup, REC_TYPE_FROM, sender); diff --git a/postfix/src/master/master.c b/postfix/src/master/master.c index 337ba7931..b5c7e9617 100644 --- a/postfix/src/master/master.c +++ b/postfix/src/master/master.c @@ -159,6 +159,7 @@ /* Global library. */ #include +#include #include #include #include @@ -364,7 +365,7 @@ int main(int argc, char **argv) master_config(); master_sigsetup(); master_flow_init(); - msg_info("daemon started"); + msg_info("daemon started -- version %s", var_mail_version); /* * Process events. The event handler will execute the read/write/timer diff --git a/postfix/src/nqmgr/qmgr_deliver.c b/postfix/src/nqmgr/qmgr_deliver.c index 93c8e7c98..d8de110c9 100644 --- a/postfix/src/nqmgr/qmgr_deliver.c +++ b/postfix/src/nqmgr/qmgr_deliver.c @@ -160,7 +160,7 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream) nexthop = (cp = strrchr(entry->queue->name, '@')) != 0 && cp[1] ? cp + 1 : entry->queue->name; attr_print(stream, ATTR_FLAG_MORE, - ATTR_TYPE_NUM, MAIL_ATTR_DFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, message->queue_name, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, message->queue_id, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, message->data_offset, diff --git a/postfix/src/nqmgr/qmgr_entry.c b/postfix/src/nqmgr/qmgr_entry.c index e1e733f2a..45c8b7f61 100644 --- a/postfix/src/nqmgr/qmgr_entry.c +++ b/postfix/src/nqmgr/qmgr_entry.c @@ -315,9 +315,18 @@ QMGR_ENTRY *qmgr_entry_create(QMGR_PEER *peer, QMGR_MESSAGE *message) else if (queue->peers.next != queue->peers.prev) msg_warn("you may need a separate master.cf transport for %s", queue->name); - else if (transport->dest_concurrency_limit / 2 > queue->busy_refcount) + else { + msg_warn("you may need to reduce %s connect and helo timeouts", + transport->name); + msg_warn("so that Postfix quickly skips unavailable hosts"); + msg_warn("you may need to increase the main.cf %s and %s", + VAR_MIN_BACKOFF_TIME, VAR_MAX_BACKOFF_TIME); + msg_warn("so that Postfix wastes less time on undeliverable mail"); msg_warn("you may need to increase the master.cf %s process limit", transport->name); + } + msg_warn("please avoid flushing the whole queue when you have"); + msg_warn("lots of deferred mail, that is bad for performance"); msg_warn("to turn off these warnings specify: %s = 0", VAR_QMGR_CLOG_WARN_TIME); queue->clog_time_to_warn = now + var_qmgr_clog_warn_time; diff --git a/postfix/src/pickup/pickup.c b/postfix/src/pickup/pickup.c index 8eceb81be..9b3dba8d3 100644 --- a/postfix/src/pickup/pickup.c +++ b/postfix/src/pickup/pickup.c @@ -191,8 +191,6 @@ static int copy_segment(VSTREAM *qfile, VSTREAM *cleanup, PICKUP_INFO *info, info->rcpt = mystrdup(vstring_str(buf)); if (type == REC_TYPE_TIME) continue; - if (type == REC_TYPE_FLGS) - continue; if (type == REC_TYPE_ATTR) { if ((error_text = split_nameval(vstring_str(buf), &attr_name, &attr_value)) != 0) { @@ -269,15 +267,6 @@ static int pickup_copy(VSTREAM *qfile, VSTREAM *cleanup, info->id, (int) (now - info->st.st_mtime) / DAY_SECONDS); } - /* - * Send our processing options. In case of trouble, request that the - * cleanup service bounces its copy of the message. because the original - * input file is not readable by the bounce service. - */ -#define PICKUP_CLEANUP_FLAGS (CLEANUP_FLAG_BOUNCE | CLEANUP_FLAG_FILTER) - - rec_fprintf(cleanup, REC_TYPE_FLGS, "%d", PICKUP_CLEANUP_FLAGS); - /* * Make sure the message has a posting-time record. */ @@ -400,17 +389,23 @@ static int pickup_file(PICKUP_INFO *info) /* * Contact the cleanup service and read the queue ID that it has - * allocated. + * allocated. In case of trouble, request that the cleanup service + * bounces its copy of the message. because the original input file is + * not readable by the bounce service. * * The actual message copying code is in a separate routine, so that it is * easier to implement the many possible error exits without forgetting * to close files, or to release memory. */ +#define PICKUP_CLEANUP_FLAGS (CLEANUP_FLAG_BOUNCE | CLEANUP_FLAG_FILTER) cleanup = mail_connect_wait(MAIL_CLASS_PUBLIC, var_cleanup_service); if (attr_scan(cleanup, ATTR_FLAG_STRICT, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, buf, - ATTR_TYPE_END) != 1) { + ATTR_TYPE_END) != 1 + || attr_print(cleanup, ATTR_FLAG_NONE, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, PICKUP_CLEANUP_FLAGS, + ATTR_TYPE_END) != 0) { status = KEEP_MESSAGE_FILE; } else { info->id = mystrdup(vstring_str(buf)); diff --git a/postfix/src/postdrop/postdrop.c b/postfix/src/postdrop/postdrop.c index 3c67a7a62..6832aa9bd 100644 --- a/postfix/src/postdrop/postdrop.c +++ b/postfix/src/postdrop/postdrop.c @@ -297,9 +297,6 @@ int main(int argc, char **argv) * * If something goes wrong, slurp up the input before responding to the * client, otherwise the client will give up after detecting SIGPIPE. - * - * XXX Need to add REC_TYPE_ATTR filtering code before we can talk directly - * to the cleanup daemon. */ vstream_control(VSTREAM_IN, VSTREAM_CTL_PATH, "stdin", VSTREAM_CTL_END); buf = vstring_alloc(100); @@ -318,17 +315,13 @@ int main(int argc, char **argv) } if (rec_type == REC_TYPE_ERROR) msg_fatal("uid=%ld: malformed input", (long) uid); + if (rec_type == REC_TYPE_TIME) + rec_fprintf(dst->stream, REC_TYPE_TIME, "%ld", + (long) time((time_t *) 0)); if (strchr(*expected, rec_type) == 0) msg_fatal("uid=%ld: unexpected record type: %d", (long) uid, rec_type); if (rec_type == **expected) expected++; - if (rec_type == REC_TYPE_TIME) { - rec_fprintf(dst->stream, REC_TYPE_TIME, "%ld", - (long) time((time_t *) 0)); - continue; - } - if (rec_type == REC_TYPE_FLGS) - continue; if (REC_PUT_BUF(dst->stream, rec_type, buf) < 0) { while ((rec_type = rec_get(VSTREAM_IN, buf, var_line_limit)) > 0 && rec_type != REC_TYPE_END) diff --git a/postfix/src/qmgr/qmgr_deliver.c b/postfix/src/qmgr/qmgr_deliver.c index bf0828109..64b170c26 100644 --- a/postfix/src/qmgr/qmgr_deliver.c +++ b/postfix/src/qmgr/qmgr_deliver.c @@ -155,7 +155,7 @@ static int qmgr_deliver_send_request(QMGR_ENTRY *entry, VSTREAM *stream) nexthop = (cp = strrchr(entry->queue->name, '@')) != 0 && cp[1] ? cp + 1 : entry->queue->name; attr_print(stream, ATTR_FLAG_MORE, - ATTR_TYPE_NUM, MAIL_ATTR_DFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, message->queue_name, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, message->queue_id, ATTR_TYPE_LONG, MAIL_ATTR_OFFSET, message->data_offset, diff --git a/postfix/src/qmgr/qmgr_entry.c b/postfix/src/qmgr/qmgr_entry.c index 7a5f9dfdb..1c0772dbe 100644 --- a/postfix/src/qmgr/qmgr_entry.c +++ b/postfix/src/qmgr/qmgr_entry.c @@ -254,9 +254,18 @@ QMGR_ENTRY *qmgr_entry_create(QMGR_QUEUE *queue, QMGR_MESSAGE *message) else if (queue->peers.next != queue->peers.prev) msg_warn("you may need a separate master.cf transport for %s", queue->name); - else if (transport->dest_concurrency_limit / 2 > queue->busy_refcount) + else { + msg_warn("you may need to reduce %s connect and helo timeouts", + transport->name); + msg_warn("so that Postfix quickly skips unavailable hosts"); + msg_warn("you may need to increase the main.cf %s and %s", + VAR_MIN_BACKOFF_TIME, VAR_MAX_BACKOFF_TIME); + msg_warn("so that Postfix wastes less time on undeliverable mail"); msg_warn("you may need to increase the master.cf %s process limit", transport->name); + } + msg_warn("please avoid flushing the whole queue when you have"); + msg_warn("lots of deferred mail, that is bad for performance"); msg_warn("to turn off these warnings specify: %s = 0", VAR_QMGR_CLOG_WARN_TIME); queue->clog_time_to_warn = now + var_qmgr_clog_warn_time; diff --git a/postfix/src/qmqpd/qmqpd.c b/postfix/src/qmqpd/qmqpd.c index b83a40403..dbcfcb4f0 100644 --- a/postfix/src/qmqpd/qmqpd.c +++ b/postfix/src/qmqpd/qmqpd.c @@ -182,7 +182,10 @@ static void qmqpd_open_file(QMQPD_STATE *state) * Connect to the cleanup server. Log client name/address with queue ID. */ state->dest = mail_stream_service(MAIL_CLASS_PUBLIC, var_cleanup_service); - if (state->dest == 0) + if (state->dest == 0 + || attr_print(state->dest->stream, ATTR_FLAG_NONE, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, CLEANUP_FLAG_FILTER, + ATTR_TYPE_END) != 0) msg_fatal("unable to connect to the %s %s service", MAIL_CLASS_PUBLIC, var_cleanup_service); state->cleanup = state->dest->stream; @@ -194,7 +197,6 @@ static void qmqpd_open_file(QMQPD_STATE *state) * bloody likely, but present for the sake of consistency with all other * Postfix points of entrance). */ - rec_fprintf(state->cleanup, REC_TYPE_FLGS, "%d", CLEANUP_FLAG_FILTER); rec_fprintf(state->cleanup, REC_TYPE_TIME, "%ld", (long) state->time); if (*var_filter_xport) rec_fprintf(state->cleanup, REC_TYPE_FILT, "%s", var_filter_xport); diff --git a/postfix/src/smtpd/smtpd.c b/postfix/src/smtpd/smtpd.c index ef81c30a8..ca31431ff 100644 --- a/postfix/src/smtpd/smtpd.c +++ b/postfix/src/smtpd/smtpd.c @@ -538,11 +538,12 @@ static void mail_open_stream(SMTPD_STATE *state) if (SMTPD_STAND_ALONE(state) == 0) { state->dest = mail_stream_service(MAIL_CLASS_PUBLIC, var_cleanup_service); - if (state->dest == 0) + if (state->dest == 0 + || attr_print(state->dest->stream, ATTR_FLAG_NONE, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, CLEANUP_FLAG_FILTER, + ATTR_TYPE_END) != 0) msg_fatal("unable to connect to the %s %s service", MAIL_CLASS_PUBLIC, var_cleanup_service); - rec_fprintf(state->dest->stream, REC_TYPE_FLGS, "%d", - CLEANUP_FLAG_FILTER); } /* diff --git a/postfix/src/smtpd/smtpd_check.c b/postfix/src/smtpd/smtpd_check.c index 2a3a38919..ab7e01cfe 100644 --- a/postfix/src/smtpd/smtpd_check.c +++ b/postfix/src/smtpd/smtpd_check.c @@ -1509,25 +1509,35 @@ static int check_table_result(SMTPD_STATE *state, const char *table, var_access_map_code, reply_name, reply_class)); /* - * HOLD means deliver later. + * HOLD means deliver later. But we may still change our mind, and + * reject/discard the message for other reasons. */ if (strcasecmp(value, "HOLD") == 0) { vstring_sprintf(error_text, "<%s>: %s triggers HOLD action", reply_name, reply_class); log_whatsup(state, "hold", STR(error_text)); +#ifndef TEST rec_fprintf(state->dest->stream, REC_TYPE_FLGS, "%d", CLEANUP_FLAG_HOLD); +#endif + return (SMTPD_CHECK_DUNNO); } /* * DISCARD means silently discard and claim successful delivery. + * + * XXX Set some global flag that disables all further restrictions. + * Triggering a "reject" or "hold" action after "discard" is silly. */ if (strcasecmp(value, "DISCARD") == 0) { vstring_sprintf(error_text, "<%s>: %s triggers DISCARD action", reply_name, reply_class); log_whatsup(state, "discard", STR(error_text)); +#ifndef TEST rec_fprintf(state->dest->stream, REC_TYPE_FLGS, "%d", CLEANUP_FLAG_DISCARD); +#endif + return (SMTPD_CHECK_OK); } /* diff --git a/postfix/src/smtpd/smtpd_peer.c b/postfix/src/smtpd/smtpd_peer.c index 4a8b2c57f..5679f8b64 100644 --- a/postfix/src/smtpd/smtpd_peer.c +++ b/postfix/src/smtpd/smtpd_peer.c @@ -107,6 +107,11 @@ void smtpd_peer_init(SMTPD_STATE *state) struct hostent *hp; int i; + /* + * Avoid suprious complaints from Purify on Solaris. + */ + memset((char *) &sin, 0, len); + /* * Look up the peer address information. */ diff --git a/postfix/src/trivial-rewrite/resolve.c b/postfix/src/trivial-rewrite/resolve.c index a3af883fc..b53d56563 100644 --- a/postfix/src/trivial-rewrite/resolve.c +++ b/postfix/src/trivial-rewrite/resolve.c @@ -291,7 +291,7 @@ int resolve_proto(VSTREAM *stream) ATTR_TYPE_STR, MAIL_ATTR_TRANSPORT, STR(channel), ATTR_TYPE_STR, MAIL_ATTR_NEXTHOP, STR(nexthop), ATTR_TYPE_STR, MAIL_ATTR_RECIP, STR(nextrcpt), - ATTR_TYPE_NUM, MAIL_ATTR_RFLAGS, flags, + ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, flags, ATTR_TYPE_END); if (vstream_fflush(stream) != 0) { diff --git a/postfix/src/util/dict_ldap.c b/postfix/src/util/dict_ldap.c index fa370107a..9eafc6613 100644 --- a/postfix/src/util/dict_ldap.c +++ b/postfix/src/util/dict_ldap.c @@ -490,6 +490,7 @@ static void dict_ldap_get_values(DICT_LDAP *dict_ldap, LDAPMessage * res, char *attr; char *myname = "dict_ldap_get_values"; struct timeval tv; + LDAPURLDesc *url; tv.tv_sec = dict_ldap->timeout; tv.tv_usec = 0; @@ -541,8 +542,14 @@ static void dict_ldap_get_values(DICT_LDAP *dict_ldap, LDAPMessage * res, if (msg_verbose) msg_info("%s: looking up URL %s", myname, vals[i]); - rc = ldap_url_search_st(dict_ldap->ld, vals[i], - 0, &tv, &resloop); + rc = ldap_url_parse(vals[i], &url); + if (rc == 0) { + rc = ldap_search_st(dict_ldap->ld, url->lud_dn, + url->lud_scope, url->lud_filter, + url->lud_attrs, 0, &tv, + &resloop); + ldap_free_urldesc(url); + } } else { if (msg_verbose) msg_info("%s: looking up DN %s", myname, vals[i]);