This patch fixes minor problems. It is released in order to stay in sync with the bugfixes in the 1.1.7-20020331 snapshot release. - Portability fix for OPENSTEP and NEXTSTEP. - Violation of the defer_transports setting: the flush server could trigger mail delivery (as if ETRN was sent) while doing some internal housekeeping of per-destination logfiles. - Virtual mapping was broken for addresses with embedded whitespace in the recipient local part. - When the super-user runs "mailq" or "postqueue -p" (list mail queue) while the mail system is down, the postqueue command runs the showq command directly. However, postqueue did not pass on non-default configuration directory settings to the showq command, so that showq would report the default mail queue instead. Prereq: "1.1.6" diff -cr ../postfix-1.1.6/src/global/mail_version.h ./src/global/mail_version.h *** ../postfix-1.1.6/src/global/mail_version.h Tue Mar 26 15:17:54 2002 --- ./src/global/mail_version.h Sun Mar 31 10:29:32 2002 *************** *** 21,38 **** * release date only, unless they include the same bugfix as a patch release. */ #define VAR_MAIL_VERSION "mail_version" ! #ifdef SNAPSHOT ! #define DEF_MAIL_VERSION "1.1.6-$mail_release_date" ! #else ! #define DEF_MAIL_VERSION "1.1.6" ! #endif extern char *var_mail_version; /* * Release date. */ #define VAR_MAIL_RELEASE "mail_release_date" ! #define DEF_MAIL_RELEASE "20020326" extern char *var_mail_release; /* LICENSE --- 21,34 ---- * release date only, unless they include the same bugfix as a patch release. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "1.1.7" extern char *var_mail_version; /* * Release date. */ #define VAR_MAIL_RELEASE "mail_release_date" ! #define DEF_MAIL_RELEASE "20020331" extern char *var_mail_release; /* LICENSE diff -cr ../postfix-1.1.6/HISTORY ./HISTORY *** ../postfix-1.1.6/HISTORY Tue Mar 26 15:39:02 2002 --- ./HISTORY Sun Mar 31 10:33:33 2002 *************** *** 6189,6194 **** --- 6189,6218 ---- of a line. Victor Duchovni, Morgan Stanley. File: sendmail/sendmail.c. + 20020328 + + Portability fix for OPENSTEP and NEXTSTEP by Gerben Wierda. + File: util/sys_defs.h. + + 20020329 + + Bugfix: defer_transports broke because the flush server + triggered mail delivery (as if ETRN was sent) while doing + some internal housekeeping of per-destination logfiles. + Problem experienced by LaMont Jones, HP. File: flush/flush.c. + + Bugfix: virtual mapping broke for addresses with embedded + whitespace. Fix by Victor Duchovni, Morgan Stanley. File: + cleanup/cleanup_map1n.c. + + 20020330 + + Bugfix: postqueue did not pass on non-default configuration + directory settings when running showq while the mail system + is down. The super-user is now exempted from environment + stripping in postqueue/postqueue.c. Problem reported by + Victor Duchovni, Morgan Stanley. + Open problems: Low: sendmail does not store null command-line recipients. diff -cr ../postfix-1.1.6/conf/sample-compatibility.cf ./conf/sample-compatibility.cf *** ../postfix-1.1.6/conf/sample-compatibility.cf Thu Mar 8 10:01:43 2001 --- ./conf/sample-compatibility.cf Sun Mar 31 10:22:01 2002 *************** *** 24,41 **** # The smtp_always_send_ehlo parameter specifies that the SMTP client # should always send EHLO at the start of an SMTP session. # ! # By default, Postfix sends EHLO only when the word "ESMTP" appears ! # in the server greeting banner (example: 220 spike.porcupine.org # ESMTP Postfix). # ! smtp_always_send_ehlo = no # The smtp_never_send_ehlo parameter specifies that the SMTP client # should never send EHLO at the start of an SMTP session. - # - # By default, Postfix sends EHLO whenever the word "ESMTP" appears - # in the server greeting banner (example: 220 spike.porcupine.org - # ESMTP Postfix). # smtp_never_send_ehlo = no --- 24,37 ---- # The smtp_always_send_ehlo parameter specifies that the SMTP client # should always send EHLO at the start of an SMTP session. # ! # If you specify "no", Postfix sends EHLO only when the word "ESMTP" ! # appears in the server greeting banner (example: 220 spike.porcupine.org # ESMTP Postfix). # ! smtp_always_send_ehlo = yes # The smtp_never_send_ehlo parameter specifies that the SMTP client # should never send EHLO at the start of an SMTP session. # smtp_never_send_ehlo = no diff -cr ../postfix-1.1.6/src/cleanup/cleanup_map1n.c ./src/cleanup/cleanup_map1n.c *** ../postfix-1.1.6/src/cleanup/cleanup_map1n.c Tue Oct 30 20:08:50 2001 --- ./src/cleanup/cleanup_map1n.c Fri Mar 29 15:27:31 2002 *************** *** 112,118 **** state->queue_id, maps->title, addr); break; } ! if ((lookup = mail_addr_map(maps, argv->argv[arg], propagate)) != 0) { saved_lhs = mystrdup(argv->argv[arg]); for (i = 0; i < lookup->argc; i++) { unquote_822_local(state->temp1, lookup->argv[i]); --- 112,119 ---- state->queue_id, maps->title, addr); break; } ! quote_822_local(state->temp1, argv->argv[arg]); ! if ((lookup = mail_addr_map(maps, STR(state->temp1), propagate)) != 0) { saved_lhs = mystrdup(argv->argv[arg]); for (i = 0; i < lookup->argc; i++) { unquote_822_local(state->temp1, lookup->argv[i]); diff -cr ../postfix-1.1.6/src/flush/flush.c ./src/flush/flush.c *** ../postfix-1.1.6/src/flush/flush.c Thu Jan 17 11:20:10 2002 --- ./src/flush/flush.c Fri Mar 29 13:42:21 2002 *************** *** 203,209 **** * name space: domain names versus safe-to-use pathnames. */ static int flush_add_path(const char *, const char *); ! static int flush_send_path(const char *); /* flush_site_to_path - convert domain or [addr] to harmless string */ --- 203,217 ---- * name space: domain names versus safe-to-use pathnames. */ static int flush_add_path(const char *, const char *); ! static int flush_send_path(const char *, int); ! ! /* ! * Do we only refresh the per-destination logfile, or do we really request ! * mail delivery as if someone sent ETRN? If the latter, we must override ! * information about unavailable hosts or unavailable transports. ! */ ! #define REFRESH_ONLY 0 ! #define REFRESH_AND_DELIVER 1 /* flush_site_to_path - convert domain or [addr] to harmless string */ *************** *** 318,324 **** /* flush_send_service - flush mail queued for site */ ! static int flush_send_service(const char *site) { char *myname = "flush_send_service"; VSTRING *site_path; --- 326,332 ---- /* flush_send_service - flush mail queued for site */ ! static int flush_send_service(const char *site, int how) { char *myname = "flush_send_service"; VSTRING *site_path; *************** *** 337,343 **** * Map site name to path name and flush the log. */ site_path = flush_site_to_path((VSTRING *) 0, site); ! status = flush_send_path(STR(site_path)); vstring_free(site_path); return (status); --- 345,351 ---- * Map site name to path name and flush the log. */ site_path = flush_site_to_path((VSTRING *) 0, site); ! status = flush_send_path(STR(site_path), how); vstring_free(site_path); return (status); *************** *** 345,361 **** /* flush_send_path - flush logfile file */ ! static int flush_send_path(const char *path) { const char *myname = "flush_send_path"; VSTRING *queue_id; VSTRING *queue_file; VSTREAM *log; struct utimbuf tbuf; ! static char qmgr_trigger[] = { QMGR_REQ_SCAN_INCOMING, /* scan incoming queue */ QMGR_REQ_FLUSH_DEAD, /* flush dead site/transport cache */ }; HTABLE *dup_filter; int count; --- 353,372 ---- /* flush_send_path - flush logfile file */ ! static int flush_send_path(const char *path, int how) { const char *myname = "flush_send_path"; VSTRING *queue_id; VSTRING *queue_file; VSTREAM *log; struct utimbuf tbuf; ! static char qmgr_deliver_trigger[] = { QMGR_REQ_SCAN_INCOMING, /* scan incoming queue */ QMGR_REQ_FLUSH_DEAD, /* flush dead site/transport cache */ }; + static char qmgr_refresh_trigger[] = { + QMGR_REQ_SCAN_INCOMING, /* scan incoming queue */ + }; HTABLE *dup_filter; int count; *************** *** 463,470 **** if (count > 0) { if (msg_verbose) msg_info("%s: requesting delivery for logfile %s", myname, path); ! mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE, ! qmgr_trigger, sizeof(qmgr_trigger)); } return (FLUSH_STAT_OK); } --- 474,485 ---- if (count > 0) { if (msg_verbose) msg_info("%s: requesting delivery for logfile %s", myname, path); ! if (how == REFRESH_ONLY) ! mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE, ! qmgr_refresh_trigger, sizeof(qmgr_refresh_trigger)); ! else ! mail_trigger(MAIL_CLASS_PUBLIC, MAIL_SERVICE_QUEUE, ! qmgr_deliver_trigger, sizeof(qmgr_deliver_trigger)); } return (FLUSH_STAT_OK); } *************** *** 503,509 **** } else if (st.st_atime + max_age < event_time()) { if (msg_verbose) msg_info("%s: flush logfile %s", myname, site_path); ! flush_send_path(site_path); } else { if (msg_verbose) msg_info("%s: skip logfile %s, unread for <%d hours(s) ", --- 518,524 ---- } else if (st.st_atime + max_age < event_time()) { if (msg_verbose) msg_info("%s: flush logfile %s", myname, site_path); ! flush_send_path(site_path, REFRESH_ONLY); } else { if (msg_verbose) msg_info("%s: skip logfile %s, unread for <%d hours(s) ", *************** *** 608,614 **** if (attr_scan(client_stream, ATTR_FLAG_STRICT, ATTR_TYPE_STR, MAIL_ATTR_SITE, site, ATTR_TYPE_END) == 1) ! status = flush_send_service(lowercase(STR(site))); attr_print(client_stream, ATTR_FLAG_NONE, ATTR_TYPE_NUM, MAIL_ATTR_STATUS, status, ATTR_TYPE_END); --- 623,630 ---- if (attr_scan(client_stream, ATTR_FLAG_STRICT, ATTR_TYPE_STR, MAIL_ATTR_SITE, site, ATTR_TYPE_END) == 1) ! status = flush_send_service(lowercase(STR(site)), ! REFRESH_AND_DELIVER); attr_print(client_stream, ATTR_FLAG_NONE, ATTR_TYPE_NUM, MAIL_ATTR_STATUS, status, ATTR_TYPE_END); diff -cr ../postfix-1.1.6/src/postqueue/postqueue.c ./src/postqueue/postqueue.c *** ../postfix-1.1.6/src/postqueue/postqueue.c Mon Mar 11 19:15:56 2002 --- ./src/postqueue/postqueue.c Sun Mar 31 10:12:42 2002 *************** *** 340,351 **** mail_conf_read(); /* ! * Strip the environment so we don't have to trust the C library. */ ! import_env = argv_split(var_import_environ, ", \t\r\n"); ! clean_env(import_env->argv); ! argv_free(import_env); ! if (chdir(var_queue_dir)) msg_fatal_status(EX_UNAVAILABLE, "chdir %s: %m", var_queue_dir); --- 340,356 ---- mail_conf_read(); /* ! * This program is designed to be set-gid, which makes it a potential ! * target for attack. If not running as root, strip the environment so we ! * don't have to trust the C library. If running as root, don't strip the ! * environment so that showq can receive non-default configuration ! * directory info when the mail system is down. */ ! if (geteuid() != 0) { ! import_env = argv_split(var_import_environ, ", \t\r\n"); ! clean_env(import_env->argv); ! argv_free(import_env); ! } if (chdir(var_queue_dir)) msg_fatal_status(EX_UNAVAILABLE, "chdir %s: %m", var_queue_dir); diff -cr ../postfix-1.1.6/src/util/sys_defs.h ./src/util/sys_defs.h *** ../postfix-1.1.6/src/util/sys_defs.h Thu Jan 3 14:20:56 2002 --- ./src/util/sys_defs.h Thu Mar 28 14:57:54 2002 *************** *** 651,656 **** --- 651,657 ---- /* It's amazing what is all missing... */ #define isascii(c) ((unsigned)(c)<=0177) extern int opterr; + typedef unsigned short mode_t; #define MISSING_PID_T #define MISSING_STRFTIME_E *************** *** 701,706 **** --- 702,708 ---- /* It's amazing what is all missing... */ #define isascii(c) ((unsigned)(c)<=0177) extern int opterr; + typedef unsigned short mode_t; #define MISSING_PID_T #define MISSING_STRFTIME_E