From: Wietse Venema Date: Thu, 22 Apr 1999 05:00:00 +0000 (-0500) Subject: snapshot-19990422 X-Git-Tag: v20010228~115 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f740cf9e5c54b792d315f027175c6df43812870;p=thirdparty%2Fpostfix.git snapshot-19990422 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index c9e68603d..27c6d153e 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -2615,35 +2615,39 @@ Apologies for any names omitted. $mydestination include files. This makes Postfix more compatible with sendmail.cw files. File: util/match_list.c. - Feature: specify "mydomain = domain.name" to have the local - domain name automagically appended to $myhostname. Files: - global/mail_params.c, postconf/postconf.c. + Feature: if your machines have short host names, specify + "mydomain = domain.name", and you no longer have to specify + "myhostname = host.domain.name". Files: global/mail_params.c, + postconf/postconf.c. -Future: +19990420 - Planned: must be able to list the same hash table in - virtual_maps and mydestination. + Cleanup: bounce mail when a mailbox goes over file quota, + instead of deferring delivery. File: local/mailbox.c. - Planned: delivered-to cache instead of table. +19990421 - Planned: hide internal loop info so that delivered-to is - no longer required. - - Planned: DNS lookups for address canonicalization. - - Planned: no more slow-down when qmgr reaches the end of - the in-memory recipient list while there's still more - recipients in the queue file. + Feature: auto-detection of changes to DB or DBM lookup + tables now includes the case where a file is unlinked. + Philip A. Prindeville, Mirapoint, Inc., USA. File: + util/dict.c. - Planned: pop pre-authentication by Joerg Henne. +19990422 - Planned: ident lookup by Jon Ribbens. + Robustness: Lotus mail sends MAIL FROM: <@> instead of <>. + Problem reported by Erik Toubro Nielsen, IFAD, Denmark. + Files: trivial-rewrite/rewrite.c (@ becomes empty address) + and global/rewrite_clnt.c (allow empty response). - Planned: $logname, $home, $shell, $user, $sender expansions - in shell commands, mailbox_command, forward_path. + Bugfix: showq could segfault when writing to a broken pipe. + Problem reported by Bryan Fullerton, Canadian Broadcasting + Corporation. Files: util/vbuf_print.c. - Planned: forward_path, for example $home/.forward (default) - or /var/forward/$logname (for mail servers). + Cleanup: got rid of the "fatal: write error: Broken pipe" + message when mailq output is piped into a program that + terminates early. - Planned: control From_, Return-Path, Delivered-To and other - features with local delivery to mailbox or command. + Cleanup: bounce messages are multipart/mixed with the error + report as part of the first message segment, because users + had trouble extracting the delivery error report from the + attachment. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 49cdc0412..0211dafb9 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,4 +1,4 @@ -Incompatible changes with snapshot-19990409: +Incompatible changes with snapshot-19990422: =========================================== - If an address extension (+foo) matches a user's .forward+foo file @@ -6,7 +6,7 @@ name, the +foo extension is no longer appended to recipient addresses listed in the .forward+foo file. This is more consistent with the way Postfix expands aliases. -Major changes with snapshot-19990409: +Major changes with snapshot-19990422: ===================================== In addition to several little bugfixes, none related to security, @@ -42,9 +42,9 @@ Macros: $user (login name), $home (home directory), $recipient_delimiter, $domain (recipient domain), and $extension (address extension). Initial code by Philip A. Prindeville, Mirapoint, Inc., USA. -- No more Postfix lockups on Solaris. The code no longer uses -Solaris UNIX-domain sockets, because they are still broken, -even with Solaris 7. +- No more Postfix lockups on Solaris (knock on wood). The code no +longer uses Solaris UNIX-domain sockets, because they are still +broken, even with Solaris 7. - Workaround for the Solaris mailtool, which keeps an exclusive kernel lock on the mailbox while its window is not iconified (specify @@ -58,8 +58,10 @@ sender and recipient mail addresses that distinguish between soft errors (always 450) and hard errors (unknown_address_reject_code, default 450). -- MIME-encapsulated bounce messages as per RFC 1892. Initial -implementation by Philip A. Prindeville, Mirapoint, Inc., USA. +- MIME-encapsulated bounce messages, making it easier to recover +bounced mail. Initial implementation by Philip A. Prindeville, +Mirapoint, Inc., USA. Support for RFC 1894 (DSN) will have to wait +until Postfix internals have been revised to support RFC 1893. - Separately configurable "postmaster" addresses for single bounces (bounce_notice_recipient), double bounces (2bounce_notice_recipient), diff --git a/postfix/bounce/bounce_notify_service.c b/postfix/bounce/bounce_notify_service.c index 075896d51..5144bd8a6 100644 --- a/postfix/bounce/bounce_notify_service.c +++ b/postfix/bounce/bounce_notify_service.c @@ -121,8 +121,12 @@ static int bounce_header(VSTREAM *bounce, VSTRING *buf, const char *dest, * MIME header. */ post_mail_fprintf(bounce, "MIME-Version: 1.0"); +#ifdef DSN post_mail_fprintf(bounce, "Content-Type: %s; report-type=%s;", - "multipart/report", "plain"); + "multipart/report", "delivery-status"); +#else + post_mail_fprintf(bounce, "Content-Type: multipart/mixed;"); +#endif post_mail_fprintf(bounce, "\tboundary=\"%s\"", boundary); post_mail_fputs(bounce, ""); post_mail_fputs(bounce, "This is a MIME-encapsulated message."); @@ -211,10 +215,12 @@ static int bounce_diagnostics(char *service, VSTREAM *bounce, VSTRING *buf, /* * MIME header. */ +#ifdef DSN post_mail_fprintf(bounce, "--%s", boundary); post_mail_fprintf(bounce, "Content-Description: %s", "Delivery error report"); - post_mail_fprintf(bounce, "Content-Type: %s", "text/plain"); + post_mail_fprintf(bounce, "Content-Type: %s", "message/delivery-status"); post_mail_fputs(bounce, ""); +#endif /* * If the bounce log cannot be found, do not raise a fatal run-time diff --git a/postfix/conf/main.cf.default b/postfix/conf/main.cf.default index eb67f4ea0..90ca4fb21 100644 --- a/postfix/conf/main.cf.default +++ b/postfix/conf/main.cf.default @@ -61,7 +61,7 @@ luser_relay = mail_name = Postfix mail_owner = postfix mail_spool_directory = /var/mail -mail_version = Snapshot-19990414 +mail_version = Snapshot-19990422 mailbox_command = mailbox_transport = maps_rbl_domains = rbl.maps.vix.com diff --git a/postfix/global/mail_version.h b/postfix/global/mail_version.h index 81a91b856..5ed04d7c7 100644 --- a/postfix/global/mail_version.h +++ b/postfix/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-19990414" +#define DEF_MAIL_VERSION "Snapshot-19990422" extern char *var_mail_version; /* LICENSE diff --git a/postfix/global/rewrite_clnt.c b/postfix/global/rewrite_clnt.c index d6e383577..a2545a78e 100644 --- a/postfix/global/rewrite_clnt.c +++ b/postfix/global/rewrite_clnt.c @@ -111,9 +111,11 @@ VSTRING *rewrite_clnt(const char *rule, const char *addr, VSTRING *result) if (msg_verbose) msg_info("rewrite_clnt: %s: %s -> %s", rule, addr, vstring_str(result)); +#if 0 if (addr[0] != 0 && STR(result)[0] == 0) msg_warn("%s: null result for: <%s>", myname, addr); else +#endif return (result); } sleep(10); /* XXX make configurable */ diff --git a/postfix/local/mailbox.c b/postfix/local/mailbox.c index 8888813d2..9ac2489df 100644 --- a/postfix/local/mailbox.c +++ b/postfix/local/mailbox.c @@ -50,6 +50,7 @@ #include #include #include +#include /* Utility library. */ @@ -76,6 +77,10 @@ #include #include +#ifndef EDQUOT +#define EDQUOT EFBIG +#endif + /* Application-specific. */ #include "local.h" @@ -205,8 +210,9 @@ static int deliver_mailbox_file(LOCAL_STATE state, USER_ATTR usr_attr) set_eugid(var_owner_uid, var_owner_gid); if (status) - defer_append(BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), - "cannot append to file %s: %s", mailbox, vstring_str(why)); + status = (errno == EDQUOT ? bounce_append : defer_append) + (BOUNCE_FLAG_KEEP, BOUNCE_ATTR(state.msg_attr), + "cannot append to file %s: %s", mailbox, vstring_str(why)); else sent(SENT_ATTR(state.msg_attr), "mailbox"); myfree(mailbox); diff --git a/postfix/sendmail/sendmail.c b/postfix/sendmail/sendmail.c index 33736e36f..d15701c76 100644 --- a/postfix/sendmail/sendmail.c +++ b/postfix/sendmail/sendmail.c @@ -458,8 +458,10 @@ static void show_queue(void) int n; /* - * Connect to the show queue service. + * Connect to the show queue service. Terminate silently when piping into + * a program that terminates early. */ + signal(SIGPIPE, SIG_DFL); if ((showq = mail_connect(MAIL_CLASS_PUBLIC, MAIL_SERVICE_SHOWQ, BLOCKING)) != 0) { while ((n = vstream_fread(showq, buf, sizeof(buf))) > 0) if (vstream_fwrite(VSTREAM_OUT, buf, n) != n) @@ -739,7 +741,7 @@ int main(int argc, char **argv) msg_fatal("-t can be used only in delivery mode"); if (extract_recipients && argv[OPTIND]) - msg_fatal("cannot delete recipients with -t"); + msg_fatal("cannot handle command-line recipients with -t"); /* * Start processing. Some modes are implemented internally (enqueue diff --git a/postfix/smtpd/smtpd.c b/postfix/smtpd/smtpd.c index f7482e4f7..6b88e9e85 100644 --- a/postfix/smtpd/smtpd.c +++ b/postfix/smtpd/smtpd.c @@ -637,7 +637,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv) * whitespace, so that it won't be considered as being part of our own * Received: header. What an ugly Kluge. */ - if (vstream_ferror(state->cleanup)) + if (vstream_fflush(state->cleanup)) state->err = CLEANUP_STAT_WRITE; for (prev_rec_type = 0; /* void */ ; prev_rec_type = curr_rec_type) { diff --git a/postfix/trivial-rewrite/rewrite.c b/postfix/trivial-rewrite/rewrite.c index b2dc90587..93ec33f3e 100644 --- a/postfix/trivial-rewrite/rewrite.c +++ b/postfix/trivial-rewrite/rewrite.c @@ -104,6 +104,16 @@ void rewrite_tree(char *unused_ruleset, TOK822 *tree) && VSTRING_LEN(tree->tail->vstr) == 0) return; + /* + * Treat a lone @ as if it were an empty address. + */ + if (tree->head == tree->tail + && tree->tail->type == '@') { + tok822_free_tree(tok822_sub_keep_before(tree, tree->tail)); + tok822_sub_append(tree, tok822_alloc(TOK822_QSTRING, "")); + return; + } + /* * Strip source route. */ diff --git a/postfix/util/dict.c b/postfix/util/dict.c index f4931aec9..899c6c50b 100644 --- a/postfix/util/dict.c +++ b/postfix/util/dict.c @@ -110,7 +110,7 @@ /* Application context from the caller. /* .PP /* dict_changed() returns non-zero when any dictionary needs to -/* be re-opened because it has changed. +/* be re-opened because it has changed or because it was unlinked. /* /* dict_load_file() reads name-value entries from the named file. /* Lines that begin with whitespace are concatenated to the preceding @@ -471,7 +471,7 @@ int dict_changed(void) msg_warn("%s: table %s: null time stamp", myname, h->key); if (fstat(dict->fd, &st) < 0) msg_fatal("%s: fstat: %m", myname); - status = (st.st_mtime != dict->mtime); + status = (st.st_mtime != dict->mtime || st.st_nlink == 0); } myfree((char *) ht_info_list); return (status); diff --git a/postfix/util/vbuf_print.c b/postfix/util/vbuf_print.c index a820e42b6..216e2e2f9 100644 --- a/postfix/util/vbuf_print.c +++ b/postfix/util/vbuf_print.c @@ -189,7 +189,7 @@ VBUF *vbuf_print(VBUF *bp, const char *format, va_list ap) s = va_arg(ap, char *); if (prec > 0 || (width > 0 && width > strlen(s))) { if (VBUF_SPACE(bp, (width > prec ? width : prec) + INT_SPACE)) - break; + return (bp); sprintf((char *) bp->ptr, vstring_str(fmt), s); VBUF_SKIP(bp); } else { @@ -203,7 +203,7 @@ VBUF *vbuf_print(VBUF *bp, const char *format, va_list ap) case 'x': case 'X': if (VBUF_SPACE(bp, (width > prec ? width : prec) + INT_SPACE)) - break; + return (bp); if (long_flag) sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, long)); else @@ -214,7 +214,7 @@ VBUF *vbuf_print(VBUF *bp, const char *format, va_list ap) case 'f': case 'g': if (VBUF_SPACE(bp, (width > prec ? width : prec) + DBL_SPACE)) - break; + return (bp); sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, double)); VBUF_SKIP(bp); break; @@ -223,7 +223,7 @@ VBUF *vbuf_print(VBUF *bp, const char *format, va_list ap) break; case 'p': if (VBUF_SPACE(bp, (width > prec ? width : prec) + PTR_SPACE)) - break; + return (bp); sprintf((char *) bp->ptr, vstring_str(fmt), va_arg(ap, char *)); VBUF_SKIP(bp); break;