Postfix non-beta release 20010228 patch 06 fixes problems that were recently reported on the postfix-users mailing list. None of these are critical. See the HISTORY comments below. A patch is appended below the signature. A complete source kit, postfix-20010228-pl06.tar.gz, will be made available from the primary site: ftp://ftp.porcupine.org/mirrors/postfix-release/official/ http://ftp.porcupine.org/mirrors/postfix-release/index.html including a PGP signature (postfix-20010228-pl06.tar.gz.sig). These files are expected to arrive on the Postfix download sites in a day or so. See http://www.postfix.org/ for a list of download sites. Wietse Prereq: "Postfix-20010228-pl05" diff -cr ../postfix-20010228-pl05/src/global/mail_version.h ./src/global/mail_version.h *** ../postfix-20010228-pl05/src/global/mail_version.h Mon Sep 17 16:12:24 2001 --- ./src/global/mail_version.h Sun Nov 4 10:05:58 2001 *************** *** 15,21 **** * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-20010228-pl05" extern char *var_mail_version; /* LICENSE --- 15,21 ---- * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-20010228-pl06" extern char *var_mail_version; /* LICENSE diff -cr ../postfix-20010228-pl05/HISTORY ./HISTORY *** ../postfix-20010228-pl05/HISTORY Mon Sep 17 17:44:21 2001 --- ./HISTORY Sun Nov 4 10:35:50 2001 *************** *** 5109,5111 **** --- 5109,5155 ---- above bug could cause an address to grow exponentially in size. Problem reported by Victor Duchovni, Morgan Stanley. File: global/split_addr.c. + + 20010918 + + Bugfix: the mail_addr_map() fix was almost but not quite + right. It took two clever people and several iterations of + email to really fix the mail_addr_map() problem. Thanks + to Victor Duchovni and Liviu Daia. + + 20011016 + + Bugfix: As of 20000625, Errors-To: was broken, because the + code to extract the address was not moved from recipient + address rewriting to sender address rewriting. Problem + reported by Roelof Osinga @ nisser.com. File: + cleanup/cleanup_message.c. + + 20011023 + + Bugfix: the FILTER_README content filtering example had + not been updated to include the sendmail "-i" command line + option. + + 20011029 + + Bugfix: virtual map expansion terminated early because the + detection of self-referential entries was flawed. File: + cleanup/cleanup_map1n.c. + + 20011031 + + Bugfix: mail_date() mis-formatted negative time zone offsets + with fractional hours (-03-30 instead of -0330). Fix by + Chad House, greyfirst.ca. File: global/mail_date.c. + + 20011103 + + Bugfix: Postfix would log the wrong error text when locally + submitted mail was deferred due to "soft_bounce = yes". + + Bugfix: The LDAP client dropped any entries that don't have + the result_attribute, but errored out when a DN didn't + exist. The behavior is now consistent: treat non-existant + DN's in a special result attribute expansion the same as + DN's with no attribute. LaMont Jones, HP. diff -cr ../postfix-20010228-pl05/FILTER_README ./FILTER_README *** ../postfix-20010228-pl05/FILTER_README Thu Mar 1 09:40:21 2001 --- ./FILTER_README Tue Oct 23 18:51:20 2001 *************** *** 57,63 **** # Localize these INSPECT_DIR=/var/spool/filter ! SENDMAIL=/usr/sbin/sendmail # Exit codes from EX_TEMPFAIL=75 --- 57,63 ---- # Localize these INSPECT_DIR=/var/spool/filter ! SENDMAIL="/usr/sbin/sendmail -i" # Exit codes from EX_TEMPFAIL=75 diff -cr ../postfix-20010228-pl05/INSTALL ./INSTALL *** ../postfix-20010228-pl05/INSTALL Fri Apr 27 13:45:52 2001 --- ./INSTALL Sun Nov 4 10:35:01 2001 *************** *** 140,145 **** --- 140,152 ---- That's seven backslashes :-) But at least this works with sh and csh. + In order to build Postfix for very large applications, where you + expect to run more than 1000 delivery processes, you may need to + override the definition of the FD_SETSIZE macro to make select() + work correctly: + + % make makefiles CCARGS=-DFD_SETSIZE=2048 + In any case, if the command % make diff -cr ../postfix-20010228-pl05/src/cleanup/cleanup_api.c ./src/cleanup/cleanup_api.c *** ../postfix-20010228-pl05/src/cleanup/cleanup_api.c Sun Sep 24 14:12:58 2000 --- ./src/cleanup/cleanup_api.c Sun Nov 4 10:09:57 2001 *************** *** 225,232 **** state->queue_id, state->sender) == 0) { state->errs = 0; } else { ! msg_warn("%s: bounce message failure", state->queue_id); ! state->errs = CLEANUP_STAT_WRITE; } } if (REMOVE(cleanup_path)) --- 225,234 ---- state->queue_id, state->sender) == 0) { state->errs = 0; } else { ! if (var_soft_bounce == 0) { ! msg_warn("%s: bounce message failure", state->queue_id); ! state->errs = CLEANUP_STAT_WRITE; ! } } } if (REMOVE(cleanup_path)) diff -cr ../postfix-20010228-pl05/src/cleanup/cleanup_map1n.c ./src/cleanup/cleanup_map1n.c *** ../postfix-20010228-pl05/src/cleanup/cleanup_map1n.c Thu Oct 26 12:40:26 2000 --- ./src/cleanup/cleanup_map1n.c Tue Oct 30 20:08:50 2001 *************** *** 101,107 **** break; } for (count = 0; /* void */ ; count++) { ! if (been_here_fixed(been_here, argv->argv[arg]) != 0) break; if (count >= MAX_RECURSION) { msg_warn("%s: unreasonable %s map nesting for %s", --- 101,111 ---- break; } for (count = 0; /* void */ ; count++) { ! ! /* ! * Don't expand an address that already expanded into itself. ! */ ! if (been_here_check_fixed(been_here, argv->argv[arg]) != 0) break; if (count >= MAX_RECURSION) { msg_warn("%s: unreasonable %s map nesting for %s", *************** *** 118,123 **** --- 122,133 ---- argv_add(argv, STR(state->temp1), ARGV_END); argv_terminate(argv); } + + /* + * Allow an address to expand into itself once. + */ + if (strcasecmp(saved_lhs, STR(state->temp1)) == 0) + been_here_fixed(been_here, saved_lhs); } myfree(saved_lhs); argv_free(lookup); diff -cr ../postfix-20010228-pl05/src/cleanup/cleanup_message.c ./src/cleanup/cleanup_message.c *** ../postfix-20010228-pl05/src/cleanup/cleanup_message.c Mon Nov 20 13:05:07 2000 --- ./src/cleanup/cleanup_message.c Tue Oct 16 21:23:03 2001 *************** *** 185,190 **** --- 185,196 ---- if (hdr_opts->type == HDR_RESENT_FROM && state->resent_from == 0) state->resent_from = cleanup_extract_internal(state->header_buf, *tpp); + if (hdr_opts->type == HDR_RETURN_RECEIPT_TO && !state->return_receipt) + state->return_receipt = + cleanup_extract_internal(state->header_buf, *tpp); + if (hdr_opts->type == HDR_ERRORS_TO && !state->errors_to) + state->errors_to = + cleanup_extract_internal(state->header_buf, *tpp); } vstring_sprintf(state->header_buf, "%s: ", hdr_opts->name); tok822_externalize(state->header_buf, tree, TOK822_STR_HEAD); *************** *** 232,243 **** } if (cleanup_masq_domains) cleanup_masquerade_tree(*tpp, cleanup_masq_domains); - if (hdr_opts->type == HDR_RETURN_RECEIPT_TO && !state->return_receipt) - state->return_receipt = - cleanup_extract_internal(state->header_buf, *tpp); - if (hdr_opts->type == HDR_ERRORS_TO && !state->errors_to) - state->errors_to = - cleanup_extract_internal(state->header_buf, *tpp); } vstring_sprintf(state->header_buf, "%s: ", hdr_opts->name); tok822_externalize(state->header_buf, tree, TOK822_STR_HEAD); --- 238,243 ---- diff -cr ../postfix-20010228-pl05/src/global/mail_addr_map.c ./src/global/mail_addr_map.c *** ../postfix-20010228-pl05/src/global/mail_addr_map.c Mon Sep 17 17:34:47 2001 --- ./src/global/mail_addr_map.c Sun Oct 7 17:55:23 2001 *************** *** 68,73 **** --- 68,74 ---- /* Application-specific. */ #define STR vstring_str + #define LEN VSTRING_LEN /* mail_addr_map - map a canonical address */ *************** *** 88,94 **** if ((string = mail_addr_find(path, address, &extension)) != 0) { /* ! * Prepend the original user to @otherdomain. */ if (*string == '@') { buffer = vstring_alloc(100); --- 89,96 ---- if ((string = mail_addr_find(path, address, &extension)) != 0) { /* ! * Prepend the original user to @otherdomain, but do not propagate ! * the unmatched address extension. */ if (*string == '@') { buffer = vstring_alloc(100); *************** *** 96,121 **** vstring_strncpy(buffer, address, ratsign - address); else vstring_strcpy(buffer, address); vstring_strcat(buffer, string); string = STR(buffer); - - /* - * The above code copies the address, including address - * extension, to the result. Discard the address extension at - * this point, to prevent a second address extension copy by - * mail_addr_crunch() below. Fix by Victor Duchovni, Morgan - * Stanley. - * - * In combination with an obscure bug in the split_addr() routine - * that mis-parsed an address without information before the - * extension, this could result in the exponential growth of the - * size of an address. Problem reported by Victor Duchovni, - * Morgan Stanley. - */ - if (extension) { - myfree(extension); - extension = 0; - } } /* --- 98,107 ---- vstring_strncpy(buffer, address, ratsign - address); else vstring_strcpy(buffer, address); + if (extension) + vstring_truncate(buffer, LEN(buffer) - strlen(extension)); vstring_strcat(buffer, string); string = STR(buffer); } /* *************** *** 175,187 **** /* * Initialize. */ mail_conf_read(); msg_verbose = 1; - var_rcpt_delim = "+"; if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK); while (vstring_fgets_nonl(buffer, VSTREAM_IN)) { if ((result = mail_addr_map(path, STR(buffer), 1)) != 0) argv_free(result); } --- 161,183 ---- /* * Initialize. */ + #define UPDATE(dst, src) { myfree(dst); dst = mystrdup(src); } + mail_conf_read(); msg_verbose = 1; if (chdir(var_queue_dir) < 0) msg_fatal("chdir %s: %m", var_queue_dir); path = maps_create(argv[0], argv[1], DICT_FLAG_LOCK); while (vstring_fgets_nonl(buffer, VSTREAM_IN)) { + msg_info("=== Address extension on, extension propagation on ==="); + UPDATE(var_rcpt_delim, "+"); + if ((result = mail_addr_map(path, STR(buffer), 1)) != 0) + argv_free(result); + msg_info("=== Address extension on, extension propagation off ==="); + if ((result = mail_addr_map(path, STR(buffer), 0)) != 0) + argv_free(result); + msg_info("=== Address extension off ==="); + UPDATE(var_rcpt_delim, ""); if ((result = mail_addr_map(path, STR(buffer), 1)) != 0) argv_free(result); } diff -cr ../postfix-20010228-pl05/src/global/mail_date.c ./src/global/mail_date.c *** ../postfix-20010228-pl05/src/global/mail_date.c Tue Mar 16 12:55:41 1999 --- ./src/global/mail_date.c Wed Oct 31 13:06:46 2001 *************** *** 115,121 **** if (gmtoff < -DAY_MIN || gmtoff > DAY_MIN) msg_panic("UTC time offset %d is larger than one day", gmtoff); vstring_sprintf_append(vp, "%+03d%02d", (int) (gmtoff / HOUR_MIN), ! (int) (gmtoff % HOUR_MIN)); /* * Finally, add the time zone name. --- 115,121 ---- if (gmtoff < -DAY_MIN || gmtoff > DAY_MIN) msg_panic("UTC time offset %d is larger than one day", gmtoff); vstring_sprintf_append(vp, "%+03d%02d", (int) (gmtoff / HOUR_MIN), ! (int) (abs(gmtoff) % HOUR_MIN)); /* * Finally, add the time zone name. diff -cr ../postfix-20010228-pl05/src/global/split_addr.c ./src/global/split_addr.c *** ../postfix-20010228-pl05/src/global/split_addr.c Mon Sep 17 17:27:06 2001 --- ./src/global/split_addr.c Tue Sep 18 10:19:59 2001 *************** *** 67,73 **** /* * Backwards compatibility: don't split owner-foo or foo-request. */ ! if (var_ownreq_special != 0) { if (strncasecmp(localpart, "owner-", 6) == 0) return (0); if ((len = strlen(localpart) - 8) > 0 --- 67,73 ---- /* * Backwards compatibility: don't split owner-foo or foo-request. */ ! if (delimiter == '-' && var_ownreq_special != 0) { if (strncasecmp(localpart, "owner-", 6) == 0) return (0); if ((len = strlen(localpart) - 8) > 0 diff -cr ../postfix-20010228-pl05/src/util/dict_ldap.c ./src/util/dict_ldap.c *** ../postfix-20010228-pl05/src/util/dict_ldap.c Tue Jul 17 15:56:27 2001 --- ./src/util/dict_ldap.c Sat Nov 3 20:09:16 2001 *************** *** 373,385 **** dict_ldap->result_attributes->argv, 0, &tv, &resloop); } ! if (rc == LDAP_SUCCESS) ! dict_ldap_get_values(dict_ldap, resloop, result); ! else { ! msg_warn("%s: search error %d: %s ", myname, rc, ldap_err2string(rc)); ! dict_errno = DICT_ERR_RETRY; } if (resloop != 0) ldap_msgfree(resloop); } --- 373,396 ---- dict_ldap->result_attributes->argv, 0, &tv, &resloop); } ! switch (rc) { ! case LDAP_SUCCESS: ! dict_ldap_get_values(dict_ldap, resloop, result); ! break; ! case LDAP_NO_SUCH_OBJECT: ! /* Go ahead and treat this as though the DN existed ! * and just didn't have any result attributes. ! */ ! msg_warn("%s: DN %s not found, skipping ", myname, ! vals[i]); ! break; ! default: ! msg_warn("%s: search error %d: %s ", myname, rc, ldap_err2string(rc)); ! dict_errno = DICT_ERR_RETRY; ! break; } + if (resloop != 0) ldap_msgfree(resloop); }