From a8ed8b608c2d703a258d358b819898a91edad52f Mon Sep 17 00:00:00 2001 From: Wietse Venema Date: Tue, 30 Oct 2001 00:00:00 -0500 Subject: [PATCH] snapshot-20011030 --- postfix/DB_README | 5 +++++ postfix/HISTORY | 20 +++++++++++++------- postfix/INSTALL | 13 +++++++------ postfix/conf/sample-filter.cf | 2 ++ postfix/conf/sample-smtpd.cf | 10 +++++----- postfix/errors_to | 0 postfix/src/bounce/bounce.c | 2 +- postfix/src/cleanup/cleanup.c | 2 +- postfix/src/cleanup/cleanup.h | 2 +- postfix/src/cleanup/cleanup_api.c | 14 +++++++------- postfix/src/cleanup/cleanup_map1n.c | 2 +- postfix/src/cleanup/cleanup_out_recipient.c | 7 +------ postfix/src/flush/flush.c | 9 ++++++--- postfix/src/global/mail_version.h | 2 +- postfix/src/global/post_mail.c | 7 ++++--- postfix/src/local/forward.c | 2 +- postfix/src/util/attr_print.c | 2 +- postfix/src/util/attr_scan.c | 2 +- 18 files changed, 58 insertions(+), 45 deletions(-) delete mode 100644 postfix/errors_to diff --git a/postfix/DB_README b/postfix/DB_README index 49cf41c30..453aff676 100644 --- a/postfix/DB_README +++ b/postfix/DB_README @@ -48,6 +48,11 @@ compatible with that of versions 2 and 3 (versions 2 and 3 have the same format). If you switch between DB versions, then you may have to rebuild all your Postfix DB files. +Warning: if you use Berkeley DB version 2 or later, do not enable +DB 1.85 compatibility mode. Doing so would break file locking on +Solaris, HP-UX, UNIXWARE, IRIX and other systems, causing mail to +be lost when you update a table while Postfix is running. + Building Postfix on Linux with a specific Berkeley DB version ============================================================= diff --git a/postfix/HISTORY b/postfix/HISTORY index fffd1d750..11a84fe11 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -5489,19 +5489,20 @@ Apologies for any names omitted. 20011010 - Specify the name of the UNIX-domain socket (instead of - "unknown stream") when a Postfix daemon complains about a - malformed client request. Files: master/*server.c. + Postfix daemons now print the name of the UNIX-domain socket + (instead of "unknown stream") complaining about a malformed + client request. Files: master/*server.c. 20011010-14 Replaced the internal protocols by (name,value) attribute lists. This gives better error detection when we start - making changes to internal protocols. + making changes to internal protocols, and allows new + attributes to be introduced without breaking protocols. 20011015 - Put base 64 encoding into place on the replced internal + Put base 64 encoding into place on the replaced internal protocols. Files: util/base64_code.[hc]. Feature: header/body REJECT rules can now end in text that @@ -5524,13 +5525,18 @@ Apologies for any names omitted. Open problems: + Medium: need in-process caching for map lookups. + Minor: The $process_id_directory setting is not used anywhere in Postfix. Problem reported by Michael Smith, texas.net. This should either be documented, or better, the code should - issue a warning to set a read-only parameter. + warn about attempts to set a read-only parameter. Medium: address rewriting should be on/off configurable for envelopes and/or headers. - Medium: smtpd access maps doesn't understand the recipient + Medium: smtpd access maps don't understand the recipient delimiter setting. + + Low: the virtual delivery agent needs a way to specify + fixed uid/gid for all deliveries. diff --git a/postfix/INSTALL b/postfix/INSTALL index 6e74ebcbf..822158c19 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -152,15 +152,16 @@ In any case, if the command % make produces compiler error messages, it may be time to examine the -FAQ document. +FAQ document (see htlm/faq.html). 5 - Porting to on an unsupported system ======================================= -- Choose a SYSTEMTYPE name for the new system. Please use a name -that includes the major version of the operating system (such as -SUNOS4 or LINUX2), so that different releases of the same system -can be supported without confusion. +- Each system type is identified by a unique name. Examples: +SUNOS5, FREEBSD4, and so on. Choose a SYSTEMTYPE name for the new +system. You must use a name that includes at least the major version +of the operating system (such as SUNOS4 or LINUX2), so that different +releases of the same system can be supported without confusion. - Add a case statement to the "makedefs" shell script in the top-level directory that recognizes the new system reliably, and @@ -222,7 +223,7 @@ In order to install or upgrade Postfix: The INSTALL.sh script offers suggestions for pathnames that you can override, either by editing INSTALL.sh or by specifying your preferences interactively. INSTALL.sh stores your preferences in - the Postfix configuration directory in order to ease future installs. + /etc/postfix/install.cf in order to ease future installs. - Proceed to the section on how you wish to run Postfix on your particular machine: diff --git a/postfix/conf/sample-filter.cf b/postfix/conf/sample-filter.cf index af68d4b3d..a52671e13 100644 --- a/postfix/conf/sample-filter.cf +++ b/postfix/conf/sample-filter.cf @@ -35,6 +35,8 @@ header_checks = regexp:/etc/postfix/header_checks # # REJECT the entire message is rejected. # +# REJECT text.... The text is sent to the originator. +# # IGNORE the body line is silently discarded. # # OK Nothing happens. The message will still be rejected when some diff --git a/postfix/conf/sample-smtpd.cf b/postfix/conf/sample-smtpd.cf index 0a8ba1f84..ed084a942 100644 --- a/postfix/conf/sample-smtpd.cf +++ b/postfix/conf/sample-smtpd.cf @@ -40,7 +40,7 @@ smtpd_banner = $myhostname ESMTP $mail_name # maptype:mapname: look up client name, parent domains, client address, # or networks obtained by stripping octets. # Reject if result is REJECT or "[45]xx text" -# Permit result is OK or all numerical. +# Permit if result is OK or all numerical. # reject_maps_rbl: reject if the reverse client network address # is listed under $maps_rbl_domains. # reject: reject the request. Place this at the end of a restriction. @@ -154,7 +154,7 @@ mynetworks_style = subnet # maptype:mapname: look up client name, parent domains, client address, # or networks obtained by stripping octets. # Reject if result is REJECT or "[45]xx text" -# Permit result is OK or all numerical. +# Permit if result is OK or all numerical. # reject_maps_rbl: reject if the client is listed under $maps_rbl_domains. # reject: reject the request. Place this at the end of a restriction. # permit: permit the request. Place this at the end of a restriction. @@ -191,7 +191,7 @@ smtpd_helo_required = no # check_helo_access maptype:mapname # maptype:mapname: look up HELO hostname or parent domains. # Reject if result is REJECT or "[45]xx text" -# Permit result is OK or all numerical. +# Permit if result is OK or all numerical. # check_client_access maptype:mapname: see smtpd_client_restrictions. # reject: reject the request. Place this at the end of a restriction. # permit: permit the request. Place this at the end of a restriction. @@ -221,7 +221,7 @@ smtpd_helo_restrictions = # check_sender_access maptype:mapname # maptype:mapname: look up sender address, parent domain, or localpart@. # Reject if result is REJECT or "[45]xx text" -# Permit result is OK or all numerical. +# Permit if result is OK or all numerical. # check_client_access maptype:mapname: see smtpd_client_restrictions. # check_helo_access maptype:mapname: see smtpd_helo_restrictions. # reject_non_fqdn_hostname: reject HELO hostname that is not in FQDN form @@ -289,7 +289,7 @@ smtpd_sender_restrictions = # check_recipient_access maptype:mapname # maptype:mapname: look up recipient address, parent domain, or localpart@. # Reject if result is REJECT or "[45]xx text" -# Permit result is OK or all numerical. +# Permit if result is OK or all numerical. # check_client_access maptype:mapname: see smtpd_client_restrictions. # check_helo_access maptype:mapname: see smtpd_helo_restrictions. # check_sender_access maptype:mapname: see smtpd_sender_restrictions. diff --git a/postfix/errors_to b/postfix/errors_to deleted file mode 100644 index e69de29bb..000000000 diff --git a/postfix/src/bounce/bounce.c b/postfix/src/bounce/bounce.c index 6e85b0dfe..03a137dad 100644 --- a/postfix/src/bounce/bounce.c +++ b/postfix/src/bounce/bounce.c @@ -227,7 +227,7 @@ static int bounce_verp_proto(char *service_name, VSTREAM *client, int flush) /* * Read and validate the client request. */ - if (attr_scan(client, ATTR_FLAG_MISSING | ATTR_FLAG_EXTRA, + if (mail_command_server(client, ATTR_TYPE_NUM, MAIL_ATTR_FLAGS, &flags, ATTR_TYPE_STR, MAIL_ATTR_QUEUE, queue_name, ATTR_TYPE_STR, MAIL_ATTR_QUEUEID, queue_id, diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c index 594f2bbdf..acdde16fd 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -234,7 +234,7 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv) * Finish this message, and report the result status to the client. */ attr_print(src, ATTR_FLAG_NONE, - ATTR_TYPE_NUM, MAIL_ATTR_STATUS, cleanup_close(state), + ATTR_TYPE_NUM, MAIL_ATTR_STATUS, cleanup_flush(state), ATTR_TYPE_STR, MAIL_ATTR_WHY, state->reason ? state->reason : "", ATTR_TYPE_END); diff --git a/postfix/src/cleanup/cleanup.h b/postfix/src/cleanup/cleanup.h index 955a014ef..09d700ed1 100644 --- a/postfix/src/cleanup/cleanup.h +++ b/postfix/src/cleanup/cleanup.h @@ -104,7 +104,7 @@ extern void cleanup_state_free(CLEANUP_STATE *); */ extern CLEANUP_STATE *cleanup_open(void); extern void cleanup_control(CLEANUP_STATE *, int); -extern int cleanup_close(CLEANUP_STATE *); +extern int cleanup_flush(CLEANUP_STATE *); extern void cleanup_free(CLEANUP_STATE *); extern void cleanup_all(void); extern void cleanup_pre_jail(char *, char **); diff --git a/postfix/src/cleanup/cleanup_api.c b/postfix/src/cleanup/cleanup_api.c index 4728be595..f361f16e1 100644 --- a/postfix/src/cleanup/cleanup_api.c +++ b/postfix/src/cleanup/cleanup_api.c @@ -18,7 +18,7 @@ /* char *buf; /* int len; /* -/* int cleanup_close(state) +/* int cleanup_flush(state) /* CLEANUP_STATE *state; /* /* int cleanup_free(state) @@ -30,7 +30,7 @@ /* /* cleanup_open() creates a new queue file and performs other /* per-message initialization. The result is a handle that should be -/* given to the cleanup_control(), cleanup_record(), cleanup_close() +/* given to the cleanup_control(), cleanup_record(), cleanup_flush() /* and cleanup_free() routines. The name of the queue file is in the /* queue_id result structure member. /* @@ -54,9 +54,9 @@ /* REC_TYPE_END. In order to find out if a message is corrupted, /* the caller is encouraged to test the CLEANUP_OUT_OK(state) macro. /* The result is false when further message processing is futile. -/* In that case, it is safe to call cleanup_close() immediately. +/* In that case, it is safe to call cleanup_flush() immediately. /* -/* cleanup_close() closes a queue file. In case of any errors, +/* cleanup_flush() closes a queue file. In case of any errors, /* the file is removed. The result value is non-zero in case of /* problems. In some cases a human-readable text can be found in /* the state->reason member. In all other cases, use cleanup_strerror() @@ -170,9 +170,9 @@ void cleanup_control(CLEANUP_STATE *state, int flags) } } -/* cleanup_close - finish queue file */ +/* cleanup_flush - finish queue file */ -int cleanup_close(CLEANUP_STATE *state) +int cleanup_flush(CLEANUP_STATE *state) { char *junk; int status; @@ -261,7 +261,7 @@ int cleanup_close(CLEANUP_STATE *state) * initializations at the beginning of cleanup_open(). */ if (msg_verbose) - msg_info("cleanup_close: status %d", state->errs); + msg_info("cleanup_flush: status %d", state->errs); status = state->errs; return (status); } diff --git a/postfix/src/cleanup/cleanup_map1n.c b/postfix/src/cleanup/cleanup_map1n.c index 72127c180..d7176a434 100644 --- a/postfix/src/cleanup/cleanup_map1n.c +++ b/postfix/src/cleanup/cleanup_map1n.c @@ -127,7 +127,7 @@ ARGV *cleanup_map1n_internal(CLEANUP_STATE *state, char *addr, * Allow an address to expand into itself once. */ if (strcasecmp(saved_lhs, STR(state->temp1)) == 0) - been_here_fixed(been_here, argv->argv[arg]); + been_here_fixed(been_here, saved_lhs); } myfree(saved_lhs); argv_free(lookup); diff --git a/postfix/src/cleanup/cleanup_out_recipient.c b/postfix/src/cleanup/cleanup_out_recipient.c index 147fef30d..bb283aa3c 100644 --- a/postfix/src/cleanup/cleanup_out_recipient.c +++ b/postfix/src/cleanup/cleanup_out_recipient.c @@ -60,7 +60,6 @@ void cleanup_out_recipient(CLEANUP_STATE *state, char *recip) { ARGV *argv; char **cpp; - int envelope_changed; if (cleanup_virtual_maps == 0) { if (been_here_fixed(state->dups, recip) == 0) @@ -68,13 +67,9 @@ void cleanup_out_recipient(CLEANUP_STATE *state, char *recip) } else { argv = cleanup_map1n_internal(state, recip, cleanup_virtual_maps, cleanup_ext_prop_mask & EXT_PROP_VIRTUAL); - envelope_changed = (argv->argc > 1 || strcmp(recip, argv->argv[0])); for (cpp = argv->argv; *cpp; cpp++) - if (been_here_fixed(state->dups, *cpp) == 0) { - if (envelope_changed) - cleanup_out_string(state, REC_TYPE_ORCP, recip); + if (been_here_fixed(state->dups, *cpp) == 0) cleanup_out_string(state, REC_TYPE_RCPT, *cpp), state->rcpt_count++; - } argv_free(argv); } } diff --git a/postfix/src/flush/flush.c b/postfix/src/flush/flush.c index 8cfb68a5e..cf365545f 100644 --- a/postfix/src/flush/flush.c +++ b/postfix/src/flush/flush.c @@ -540,9 +540,12 @@ static void flush_service(VSTREAM *client_stream, char *unused_service, * All connection-management stuff is handled by the common code in * single_server.c. */ - if (attr_scan(client_stream, ATTR_FLAG_MORE | ATTR_FLAG_EXTRA | ATTR_FLAG_MISSING, - ATTR_TYPE_STR, MAIL_ATTR_REQ, request, - ATTR_TYPE_END) == 1) { + if (peekfd(vstream_fileno(client_stream)) <= 2 ? + (vstring_get_null(request, client_stream) != VSTREAM_EOF) : + (attr_scan(client_stream, + ATTR_FLAG_MORE | ATTR_FLAG_EXTRA | ATTR_FLAG_MISSING, + ATTR_TYPE_STR, MAIL_ATTR_REQ, request, + ATTR_TYPE_END) == 1)) { if (STREQ(STR(request), FLUSH_REQ_ADD)) { site = vstring_alloc(10); queue_id = vstring_alloc(10); diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index d37440660..139da4559 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20011029" +#define DEF_MAIL_VERSION "Snapshot-20011030" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/global/post_mail.c b/postfix/src/global/post_mail.c index 52ed8716c..122df9873 100644 --- a/postfix/src/global/post_mail.c +++ b/postfix/src/global/post_mail.c @@ -236,9 +236,10 @@ int post_mail_fclose(VSTREAM *cleanup) } else { rec_fputs(cleanup, REC_TYPE_XTRA, ""); rec_fputs(cleanup, REC_TYPE_END, ""); - if (vstream_fflush(cleanup) || attr_scan(cleanup, ATTR_FLAG_MISSING | ATTR_FLAG_EXTRA, - ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &status, - ATTR_TYPE_END) != 1) + if (vstream_fflush(cleanup) + || attr_scan(cleanup, ATTR_FLAG_MISSING, + ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &status, + ATTR_TYPE_END) != 1) status = CLEANUP_STAT_WRITE; } (void) vstream_fclose(cleanup); diff --git a/postfix/src/local/forward.c b/postfix/src/local/forward.c index c8fcdc145..e90b38eda 100644 --- a/postfix/src/local/forward.c +++ b/postfix/src/local/forward.c @@ -241,7 +241,7 @@ static int forward_send(FORWARD_INFO *info, DELIVER_ATTR attr, char *delivered) */ if (status == 0) if (vstream_fflush(info->cleanup) - || attr_scan(info->cleanup, ATTR_FLAG_MISSING | ATTR_FLAG_EXTRA, + || attr_scan(info->cleanup, ATTR_FLAG_MISSING, ATTR_TYPE_NUM, MAIL_ATTR_STATUS, &status, ATTR_TYPE_END) != 1) status = 1; diff --git a/postfix/src/util/attr_print.c b/postfix/src/util/attr_print.c index 4680747e0..209b94fbd 100644 --- a/postfix/src/util/attr_print.c +++ b/postfix/src/util/attr_print.c @@ -172,7 +172,7 @@ int attr_vprint(VSTREAM *fp, int flags, va_list ap) case ATTR_TYPE_NUM_ARRAY: attr_name = va_arg(ap, char *); attr_print_str(fp, attr_name, strlen(attr_name)); - ip_val = va_arg(ap, int *); + ip_val = va_arg(ap, unsigned int *); count_val = va_arg(ap, int); for (i = 0; i < count_val; i++) { VSTREAM_PUTC(':', fp); diff --git a/postfix/src/util/attr_scan.c b/postfix/src/util/attr_scan.c index 51320bf5f..4098cfb44 100644 --- a/postfix/src/util/attr_scan.c +++ b/postfix/src/util/attr_scan.c @@ -345,7 +345,7 @@ int attr_vscan(VSTREAM *fp, int flags, va_list ap) STR(name_buf), VSTREAM_PATH(fp)); return (conversions); } - number = va_arg(ap, int *); + number = va_arg(ap, unsigned int *); if ((ch = attr_scan_number(fp, number, str_buf, "attribute value")) < 0) return (conversions);