This patch fixes minor problems. It is released in order to stay in sync with the bugfixes in the upcoming 1.1.8-whatever snapshot release. - Postfix no longer attempts to build with GDBM support, because GDBM's locking behavior is broken. GDBM does not work with Sendmail, either, so this is not a Postfix specific problem. - The Postfix SMTP client forgot to quote whitespace etc. in a sender or recipient address when DNS lookup was turned off (disable_dns_lookups = yes). These setting are common on sites that are disconnected from the internet, and are used when sending mail into an SMTP-based mail content filter. - The post-install script failed to upgrade the cleanup and flush master.cf settings from private to public if services were explicitly configured as private, instead of being left at the default setting. - Better error reporting in the postqueue command. Prereq: "1.1.7" diff -cr ../postfix-1.1.7/src/global/mail_version.h ./src/global/mail_version.h *** ../postfix-1.1.7/src/global/mail_version.h Sun Mar 31 10:29:32 2002 --- ./src/global/mail_version.h Sat May 4 09:45:01 2002 *************** *** 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 --- 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.8" extern char *var_mail_version; /* * Release date. */ #define VAR_MAIL_RELEASE "mail_release_date" ! #define DEF_MAIL_RELEASE "20020504" extern char *var_mail_release; /* LICENSE diff -cr ../postfix-1.1.7/HISTORY ./HISTORY *** ../postfix-1.1.7/HISTORY Sun Mar 31 10:33:33 2002 --- ./HISTORY Sat May 4 20:10:52 2002 *************** *** 6213,6218 **** --- 6213,6254 ---- stripping in postqueue/postqueue.c. Problem reported by Victor Duchovni, Morgan Stanley. + 20020414 + + Portability: Postfix will no longer attempt to build with + gdbm support, because gdbm is broken. File: makedefs. + + 20020417 + + Bugfix: the post-install script failed to upgrade master.cf + settings from private to public if the service was explicitly + configured as private. + + 20020426 + + Bugfix: the SMTP client forgot to quote whitespace etc. + in a sender/recipient address when DNS lookup was turned + off (disable_dns_lookups = yes). Problem experienced by + Chip Paswater. Files: smtp/smtp_proto.c. + + 20020503 + + Cleanup: postqueue silently ignored command-line arguments + following -p or -f options, instead of complaining; postqueue + produced an incorrect error message (mail system down) when + the command was installed with incorrect privileges. File: + postqueue/postqueue.c. + + Bugfix: while reporting a domain name or IP address syntax + error, postqueue could dereference a dangling pointer with + some getopt() implementations. LaMont Jones, HP. File: + postqueue/postqueue.c. + + 20020504 + + Portability: run-time test to avoid GDBM trouble. File: + util/dict_dbm.c. + Open problems: Low: sendmail does not store null command-line recipients. diff -cr ../postfix-1.1.7/conf/post-install ./conf/post-install *** ../postfix-1.1.7/conf/post-install Thu Jan 24 10:28:44 2002 --- ./conf/post-install Sat May 4 09:40:04 2002 *************** *** 487,498 **** for name in cleanup flush do ! grep "^$name[ ]*unix[ ]*-" \ $config_directory/master.cf >/dev/null && { echo Editing $config_directory/master.cf, making the $name service public ed $config_directory/master.cf </dev/null && { echo Editing $config_directory/master.cf, making the $name service public ed $config_directory/master.cf <restriction... ! Apply the named UCE restriction(s) (permit, reject, reject_unauth_destination, and so on). REGULAR EXPRESSION TABLES --- 122,128 ---- tion schemes. restriction... ! Apply the named UCE restriction(s) (permit, reject, reject_unauth_destination, and so on). REGULAR EXPRESSION TABLES diff -cr ../postfix-1.1.7/html/flush.8.html ./html/flush.8.html *** ../postfix-1.1.7/html/flush.8.html Thu Jan 17 11:24:55 2002 --- ./html/flush.8.html Mon Apr 1 08:15:18 2002 *************** *** 1,5 ****
- 
  FLUSH(8)                                                 FLUSH(8)
  
  NAME
--- 1,4 ----
***************
*** 156,161 ****
         P.O. Box 704
         Yorktown Heights, NY 10598, USA
  
!                                                                 1
! 
  
--- 155,159 ---- P.O. Box 704 Yorktown Heights, NY 10598, USA ! FLUSH(8) diff -cr ../postfix-1.1.7/makedefs ./makedefs *** ../postfix-1.1.7/makedefs Sat Feb 23 09:07:06 2002 --- ./makedefs Sat May 4 09:36:23 2002 *************** *** 187,202 **** echo "See the RELEASE_NOTES file for more information." 1>&2 exit 1 fi ! # See where GDBM's ndbm.h include file sits. ! if [ -f /usr/include/gdbm-ndbm.h ] ! then ! CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=''" ! GDBM_LIBS=gdbm ! elif [ -f /usr/include/gdbm/ndbm.h ] ! then ! CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=''" ! GDBM_LIBS=gdbm ! fi SYSLIBS="-ldb" for name in nsl resolv $GDBM_LIBS do --- 187,202 ---- echo "See the RELEASE_NOTES file for more information." 1>&2 exit 1 fi ! # GDBM locks the DBM .pag file after open. This breaks postmap. ! # if [ -f /usr/include/gdbm-ndbm.h ] ! # then ! # CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=''" ! # GDBM_LIBS=gdbm ! # elif [ -f /usr/include/gdbm/ndbm.h ] ! # then ! # CCARGS="$CCARGS -DHAS_DBM -DPATH_NDBM_H=''" ! # GDBM_LIBS=gdbm ! # fi SYSLIBS="-ldb" for name in nsl resolv $GDBM_LIBS do diff -cr ../postfix-1.1.7/man/man5/access.5 ./man/man5/access.5 *** ../postfix-1.1.7/man/man5/access.5 Fri Feb 1 12:41:59 2002 --- ./man/man5/access.5 Mon Apr 1 08:15:18 2002 *************** *** 119,125 **** 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, \fRreject\fR, \fBreject_unauth_destination\fR, and so on). .SH REGULAR EXPRESSION TABLES .na --- 119,125 ---- 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). .SH REGULAR EXPRESSION TABLES .na diff -cr ../postfix-1.1.7/proto/access ./proto/access *** ../postfix-1.1.7/proto/access Fri Feb 1 12:41:52 2002 --- ./proto/access Mon Apr 1 08:15:15 2002 *************** *** 103,109 **** # 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, \fRreject\fR, # \fBreject_unauth_destination\fR, and so on). # REGULAR EXPRESSION TABLES # .ad --- 103,109 ---- # 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). # REGULAR EXPRESSION TABLES # .ad diff -cr ../postfix-1.1.7/src/postqueue/postqueue.c ./src/postqueue/postqueue.c *** ../postfix-1.1.7/src/postqueue/postqueue.c Sun Mar 31 10:12:42 2002 --- ./src/postqueue/postqueue.c Sat May 4 19:15:42 2002 *************** *** 185,190 **** --- 185,200 ---- } /* + * Don't assume that the mail system is down when the user has + * insufficient permission to access the showq socket. + */ + else if (errno == EACCES) { + msg_fatal_status(EX_SOFTWARE, + "Connect to the %s %s service: %m", + var_mail_name, MAIL_SERVICE_SHOWQ); + } + + /* * When the mail system is down, the superuser can still access the queue * directly. Just run the showq program in stand-alone mode. */ *************** *** 255,261 **** static NORETURN usage(void) { ! msg_fatal_status(EX_USAGE, "usage: specify one of -f, -p, or -s"); } /* main - the main program */ --- 265,271 ---- static NORETURN usage(void) { ! msg_fatal_status(EX_USAGE, "usage: postqueue -f | postqueue -p | postqueue -s site"); } /* main - the main program */ *************** *** 270,275 **** --- 280,286 ---- char *site_to_flush = 0; ARGV *import_env; char *last; + int bad_site; /* * Be consistent with file permissions. *************** *** 319,325 **** usage(); mode = PQ_MODE_MAILQ_LIST; break; - break; case 's': /* flush site */ if (mode != PQ_MODE_DEFAULT) usage(); --- 330,335 ---- *************** *** 333,338 **** --- 343,350 ---- usage(); } } + if (argc > optind) + usage(); /* * Further initialization... *************** *** 362,382 **** * Further input validation. */ if (site_to_flush != 0) { if (*site_to_flush == '[' && *(last = site_to_flush + strlen(site_to_flush) - 1) == ']') { *last = 0; ! if (!valid_hostaddr(site_to_flush + 1, DONT_GRIPE)) ! site_to_flush = 0; *last = ']'; } else { ! if (!valid_hostname(site_to_flush, DONT_GRIPE) ! && !valid_hostaddr(site_to_flush, DONT_GRIPE)) ! site_to_flush = 0; } ! if (site_to_flush == 0) msg_fatal_status(EX_USAGE, "Cannot flush mail queue - invalid destination: \"%.100s%s\"", ! optarg, strlen(optarg) > 100 ? "..." : ""); } /* --- 374,393 ---- * Further input validation. */ if (site_to_flush != 0) { + bad_site = 0; if (*site_to_flush == '[' && *(last = site_to_flush + strlen(site_to_flush) - 1) == ']') { *last = 0; ! bad_site = !valid_hostaddr(site_to_flush + 1, DONT_GRIPE); *last = ']'; } else { ! bad_site = (!valid_hostname(site_to_flush, DONT_GRIPE) ! && !valid_hostaddr(site_to_flush, DONT_GRIPE)); } ! if (bad_site) msg_fatal_status(EX_USAGE, "Cannot flush mail queue - invalid destination: \"%.100s%s\"", ! site_to_flush, strlen(site_to_flush) > 100 ? "..." : ""); } /* diff -cr ../postfix-1.1.7/src/smtp/smtp_proto.c ./src/smtp/smtp_proto.c *** ../postfix-1.1.7/src/smtp/smtp_proto.c Tue Mar 26 15:55:59 2002 --- ./src/smtp/smtp_proto.c Sat May 4 09:38:59 2002 *************** *** 312,317 **** --- 312,325 ---- } \ } while (0) + #define QUOTE_ADDRESS(addr) do { \ + if (*(addr)) { \ + quote_821_local(state->scratch, addr); \ + myfree(addr); \ + addr = mystrdup(vstring_str(state->scratch)); \ + } \ + } while (0) + #define RETURN(x) do { vstring_free(next_command); return (x); } while (0) #define SENDER_IS_AHEAD \ *************** *** 399,407 **** * Build the MAIL FROM command. */ case SMTP_STATE_MAIL: ! if (*request->sender) ! if (var_disable_dns == 0) ! REWRITE_ADDRESS(request->sender); vstring_sprintf(next_command, "MAIL FROM:<%s>", request->sender); if (state->features & SMTP_FEATURE_SIZE) vstring_sprintf_append(next_command, " SIZE=%lu", --- 407,417 ---- * Build the MAIL FROM command. */ case SMTP_STATE_MAIL: ! if (var_disable_dns == 0) { ! REWRITE_ADDRESS(request->sender); ! } else { ! QUOTE_ADDRESS(request->sender); ! } vstring_sprintf(next_command, "MAIL FROM:<%s>", request->sender); if (state->features & SMTP_FEATURE_SIZE) vstring_sprintf_append(next_command, " SIZE=%lu", *************** *** 415,422 **** */ case SMTP_STATE_RCPT: rcpt = request->rcpt_list.info + send_rcpt; ! if (var_disable_dns == 0) REWRITE_ADDRESS(rcpt->address); vstring_sprintf(next_command, "RCPT TO:<%s>", rcpt->address); if ((next_rcpt = send_rcpt + 1) == request->rcpt_list.len) next_state = SMTP_STATE_DATA; --- 425,435 ---- */ case SMTP_STATE_RCPT: rcpt = request->rcpt_list.info + send_rcpt; ! if (var_disable_dns == 0) { REWRITE_ADDRESS(rcpt->address); + } else { + QUOTE_ADDRESS(rcpt->address); + } vstring_sprintf(next_command, "RCPT TO:<%s>", rcpt->address); if ((next_rcpt = send_rcpt + 1) == request->rcpt_list.len) next_state = SMTP_STATE_DATA; diff -cr ../postfix-1.1.7/src/util/dict_dbm.c ./src/util/dict_dbm.c *** ../postfix-1.1.7/src/util/dict_dbm.c Mon Mar 11 19:29:15 2002 --- ./src/util/dict_dbm.c Sat May 4 09:33:28 2002 *************** *** 406,411 **** --- 406,413 ---- dict_dbm->dict.close = dict_dbm_close; dict_dbm->dict.lock_fd = dbm_dirfno(dbm); dict_dbm->dict.stat_fd = dbm_pagfno(dbm); + if (dict_dbm->dict.lock_fd == dict_dbm->dict.stat_fd) + msg_fatal("open database %s: cannot support GDBM", path); if (fstat(dict_dbm->dict.stat_fd, &st) < 0) msg_fatal("dict_dbm_open: fstat: %m"); dict_dbm->dict.mtime = st.st_mtime;