diff --git a/postfix/HISTORY b/postfix/HISTORY index e50e741fe..a3a8eb3ae 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -4973,6 +4973,16 @@ Apologies for any names omitted. with the introduction of the asynchronous bounce client. Patrik Rak. +20010313 + + Bugfix: the RFC 822 untokenizer quoted newlines inside + comments. File: global/tok822_parse.c. + +20010316 + + Cleanup: removed an extraneous warning when a queue file + write error happened. + 20010321 Workaround: LMTP connection caching never worked for @@ -4982,14 +4992,42 @@ Apologies for any names omitted. 20010322 Portability: Solaris <2.6 does not have srandom() and - random() in libc. File: util/rand_sleep.c. It does not - have to be cryptographically strong. + random() in libc. File: util/rand_sleep.c. It does not have + to be cryptographically strong. Bugfix: the fast ETRN flush server could not handle [ipaddr] - or domain names with one-character hostname part. It should - be OK now. File: flush/flush.c. + or domain names with one-character hostname part. This + fix changes the destination to logfile name mapping, so + that you need to populate the new files with "sendmail -q". + The old files go away automatically. File: flush/flush.c. 20010327 Speed up mailq (sendmail -bp) display by flushing output after each file. File: showq/showq.c. + + Portability: missing string.h includes, %p wants (void *), + Lamont Jones, HP. + +20010328 + + Bugfix: swapped logic caused cleanup to stall when the + queue file size exceeded the file size limit by less than + one the VSTREAM buffer size, so that the "file too big" + was detected after flushing the last queue file record. + File: cleanup/cleanup.c. + +20010329 + + Portability: workaround for missing prototype problem in + dict_ldap.c. This module should move to the global directory, + because it depends on Postfix main.cf parameter information. + + Workaround: after sending a trigger message over a socket, + do not immediately close the client side, but close it from + a background thread that waits until the server closes the + socket first. This avoids trouble with socket implementations + that destroy a socket when the client closes a socket + before the server has received the client's data. Files: + util/{inet,unix,stream}_trigger.c, util/events.c, + master/master_trigger.c, postkick/postkick.c. diff --git a/postfix/INSTALL b/postfix/INSTALL index a12ae5451..427a4528c 100644 --- a/postfix/INSTALL +++ b/postfix/INSTALL @@ -251,6 +251,9 @@ and watch your syslog file for any error messages. % egrep '(reject|warning|error|fatal|panic):' /some/log/file +Typical logfile names are: /var/log/maillog or /var/log/syslog. +See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. @@ -294,6 +297,9 @@ and watch your syslog file for any error messages. % egrep '(reject|warning|error|fatal|panic):' /some/log/file +Typical logfile names are: /var/log/maillog or /var/log/syslog. +See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. @@ -329,6 +335,9 @@ and watch the syslog file for any complaints from the mail system. % egrep '(reject|warning|error|fatal|panic):' /some/log/file +Typical logfile names are: /var/log/maillog or /var/log/syslog. +See /etc/syslog.conf for actual logfile names. + When it is run for the first time, the Postfix startup shell script will create a bunch of subdirectories below the Postfix spool directory. @@ -515,5 +524,11 @@ idea to run every night before the syslog files are rotated: # postfix check # egrep '(reject|warning|error|fatal|panic):' /some/log/file +Typical logfile names are: /var/log/maillog or /var/log/syslog. +See /etc/syslog.conf for actual logfile names. + +The first line (postfix check) causes Postfix to report file +permission/ownership discrepancies. + The second line looks for problem reports from the mail software, and reports how effective the anti-relay and anti-UCE blocks are. diff --git a/postfix/MYSQL_README b/postfix/MYSQL_README index e5c0c27f8..faecf80a2 100644 --- a/postfix/MYSQL_README +++ b/postfix/MYSQL_README @@ -3,7 +3,8 @@ We've written code to add a mysql map type. It utilizes the mysql client library, which can be obtained from: - http://www.tcx.se/download.html + http://www.mysql.com/downloads/ + http://sourceforge.net/projects/mysql/ In order to build postfix with mysql map support, you will need to add -DHAS_MYSQL and -I for the directory containing the mysql headers, and diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 1372a752f..ab932d0e5 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -1,7 +1,28 @@ -Release 20010228 differs from snapshot 20010228 in that the virtual -delivery agent and nqmgr queue manager are left out. That software -will become part of the official release when it has not changed -in a while. +Incompatible changes with snapshot-20010329 +=========================================== + +This release changes the names of the "fast ETRN" logfiles with +delayed mail per destination. These files are maintained by the +Postfix "fast flush" daemon. The old scheme failed with addresses +of the form user@[ip.address] and user@a.domain.name. In order to +populate the new "fast ETRN" logfiles, execute the command "sendmail +-q". The old "fast ETRN" logfiles go away by themselves (default: +after 7 days). + +Major changes with snapshot-20010329 +==================================== + +Better support for sites that run multiple Postfix instances on +one machine. Each instance can now be recognized by its logging +(default: "syslog_name = postfix"). File: global/mail_task.c. + +Workaround for nqmgr panic due to a race condition that was introduced +with the asynchronous bounce client. + +Workaround for hostile socket implementations that discard data +when a client closes a socket before the server reads the client +data. Postfix now closes the client socket in a background thread +that waits until the server closes the socket first. Incompatible changes with snapshot-20010225 =========================================== diff --git a/postfix/SASL_README b/postfix/SASL_README index 6567ab4e0..801d4f9af 100644 --- a/postfix/SASL_README +++ b/postfix/SASL_README @@ -111,7 +111,16 @@ In order to allow mail relaying by authenticated clients: permit_mynetworks permit_sasl_authenticated ... In /usr/local/lib/sasl/smtpd.conf you need to specify how the server -should validate client passwords. For example: +should validate client passwords. + +In order to authenticate against the UNIX password database, try: + + /usr/local/lib/sasl/smtpd.conf: + pwcheck_method: pwcheck + +The pwcheck daemon is contained in the cyrus-sasl source tarball. + +In order to authenticate against SASL's own password database: /usr/local/lib/sasl/smtpd.conf: pwcheck_method: sasldb @@ -129,20 +138,11 @@ IMPORTANT: To get sasldb running, make sure that you set the SASL domain EXAMPLE: saslpasswd -c -u `postconf -h myhostname` exampleuser -Instead of the SASL-specific password file you can configure the -Postfix SMTP server to validate client passwords against the UNIX -shadow password file: +To run software chrooted with SASL support is an interesting +exercise. It probably is not worth the trouble. - /usr/local/lib/sasl/smtpd.conf: - pwcheck_method: shadow - -However this requires that Postfix has read access to the UNIX shadow -password file, which is normally readable only by root. Shadow -password support has been found to work for Solaris 2.7 and RedHat -6.1 but not with FreeBSD 3.4. - -To run software chrooted with SASL support is an interesting exercise. -This is one of the many problems with the present SASL support. +Testing SASL authentication in the Postfix SMTP server +====================================================== To test the whole mess, connect to the SMTP server, and you should be able to have a conversation like this: diff --git a/postfix/conf/sample-misc.cf b/postfix/conf/sample-misc.cf index 3e0d32d4b..9f395f898 100644 --- a/postfix/conf/sample-misc.cf +++ b/postfix/conf/sample-misc.cf @@ -361,8 +361,8 @@ relocated_maps = syslog_facility = mail # The syslog_name parameter specifies the mail system name that is -# prepended to the process name in syslog records headers, so that -# "smtpd" becomes "postfix/smtpd". +# prepended to the process name in syslog records, so that "smtpd" +# becomes, for example, "postfix/smtpd". # # Beware: a non-default syslog_name setting takes effect only # after process initialization. Some initialization errors will be diff --git a/postfix/examples/chroot-setup/HPUX10 b/postfix/examples/chroot-setup/HPUX10 index ca54c658b..c8869446b 100644 --- a/postfix/examples/chroot-setup/HPUX10 +++ b/postfix/examples/chroot-setup/HPUX10 @@ -19,3 +19,5 @@ cd ${POSTFIX_DIR} mkdir etc cp /etc/services etc +mkdir -p usr/lib +cp /usr/lib/tztab usr/lib diff --git a/postfix/html/uce.html b/postfix/html/uce.html index 6333a381c..b756a43be 100644 --- a/postfix/html/uce.html +++ b/postfix/html/uce.html @@ -109,8 +109,8 @@ is allowed in message headers.
Syntax:
Specify a list of zero or more lookup tables. Whenever a header -matches a table, a REJECT result means reject the message, and a -SKIP result means delete the header from the message. +matches a table, a REJECT result means reject the message, and an +IGNORE result means delete the header from the message.

diff --git a/postfix/src/cleanup/cleanup.c b/postfix/src/cleanup/cleanup.c index 4777063ce..70476aa2e 100644 --- a/postfix/src/cleanup/cleanup.c +++ b/postfix/src/cleanup/cleanup.c @@ -215,8 +215,8 @@ static void cleanup_service(VSTREAM *src, char *unused_service, char **argv) if (CLEANUP_OUT_OK(state) == 0 && type > 0) { if ((state->errs & CLEANUP_STAT_CONT) == 0) msg_warn("%s: skipping further client input", state->queue_id); - while ((type = rec_get(src, buf, 0)) > 0 - && type != REC_TYPE_END) + while (type != REC_TYPE_END + && (type = rec_get(src, buf, 0)) > 0) /* void */ ; } diff --git a/postfix/src/flush/Makefile.in b/postfix/src/flush/Makefile.in index 432d5e572..19b51de28 100644 --- a/postfix/src/flush/Makefile.in +++ b/postfix/src/flush/Makefile.in @@ -62,7 +62,6 @@ flush.o: ../../include/vbuf.h flush.o: ../../include/vstring.h flush.o: ../../include/vstring_vstream.h flush.o: ../../include/myflock.h -flush.o: ../../include/valid_hostname.h flush.o: ../../include/htable.h flush.o: ../../include/dict.h flush.o: ../../include/argv.h diff --git a/postfix/src/global/mail_params.c b/postfix/src/global/mail_params.c index e0a36540b..82db3bd84 100644 --- a/postfix/src/global/mail_params.c +++ b/postfix/src/global/mail_params.c @@ -331,7 +331,7 @@ void mail_params_init() VAR_OWNREQ_SPECIAL, DEF_OWNREQ_SPECIAL, &var_ownreq_special, 0, }; -const char *cp; + const char *cp; /* * Extract syslog_facility early, so that from here on all errors are diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 45bad947d..5110c7251 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-20010327" +#define DEF_MAIL_VERSION "Snapshot-20010329" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/global/tok822_parse.c b/postfix/src/global/tok822_parse.c index 09b1685ff..7fd66830a 100644 --- a/postfix/src/global/tok822_parse.c +++ b/postfix/src/global/tok822_parse.c @@ -578,6 +578,10 @@ int main(int unused_argc, char **unused_argv) VSTRING *buf = vstring_alloc(100); while (readlline(buf, VSTREAM_IN, (int *) 0, READLL_KEEPNL)) { + while (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\n') { + vstring_end(buf)[-1] = 0; + vstring_truncate(buf, VSTRING_LEN(buf) - 1); + } if (!isatty(vstream_fileno(VSTREAM_IN))) vstream_printf(">>>%s<<<\n\n", vstring_str(buf)); list = tok822_parse(vstring_str(buf)); diff --git a/postfix/src/global/tok822_parse.in b/postfix/src/global/tok822_parse.in index ebc564c75..28620abc4 100644 --- a/postfix/src/global/tok822_parse.in +++ b/postfix/src/global/tok822_parse.in @@ -11,3 +11,5 @@ wietse\ venema@porcupine.org wietse@[stuff wietse@["stuff] named group: foo@bar, baz@barf; +wietse@foo (wietse + venema) diff --git a/postfix/src/global/tok822_parse.ref b/postfix/src/global/tok822_parse.ref index debfc9c3b..dc35bff57 100644 --- a/postfix/src/global/tok822_parse.ref +++ b/postfix/src/global/tok822_parse.ref @@ -264,3 +264,27 @@ Externalized, newlines inserted: named group: foo@bar, baz@barf; +>>>wietse@foo (wietse + venema)<<< + +Parse tree: + address + atom "wietse" + OP "@" + atom "foo" + comment + text "wietse + venema" + +Internalized: +wietse@foo (wietse + venema) + +Externalized, no newlines inserted: +wietse@foo (wietse + venema) + +Externalized, newlines inserted: +wietse@foo (wietse + venema) + diff --git a/postfix/src/postkick/Makefile.in b/postfix/src/postkick/Makefile.in index b34c96736..411aa984f 100644 --- a/postfix/src/postkick/Makefile.in +++ b/postfix/src/postkick/Makefile.in @@ -61,6 +61,7 @@ postkick.o: ../../include/vstream.h postkick.o: ../../include/vbuf.h postkick.o: ../../include/msg_vstream.h postkick.o: ../../include/safe.h +postkick.o: ../../include/events.h postkick.o: ../../include/mail_proto.h postkick.o: ../../include/iostuff.h postkick.o: ../../include/mail_params.h diff --git a/postfix/src/postkick/postkick.c b/postfix/src/postkick/postkick.c index 12af8b712..a4066a96a 100644 --- a/postfix/src/postkick/postkick.c +++ b/postfix/src/postkick/postkick.c @@ -160,12 +160,12 @@ int main(int argc, char **argv) /* * Kick the service. */ - if (mail_trigger(class, service, request, strlen(request) + 1) < 0) { + if (mail_trigger(class, service, request, strlen(request)) < 0) { msg_warn("Cannot contact class %s service %s - perhaps the mail system is down", class, service); exit(1); } else { - event_loop(-1); + event_drain(); exit(0); } } diff --git a/postfix/src/smtpstone/smtp-source.c b/postfix/src/smtpstone/smtp-source.c index 6ab916429..50fe6ec9a 100644 --- a/postfix/src/smtpstone/smtp-source.c +++ b/postfix/src/smtpstone/smtp-source.c @@ -781,6 +781,7 @@ int main(int argc, char **argv) message_data = mymalloc(message_length); memset(message_data, 'X', message_length); for (i = 80; i < message_length; i += 80) { + message_data[i - 80] = "0123456789"[(i/80) % 10]; message_data[i - 2] = '\r'; message_data[i - 1] = '\n'; } diff --git a/postfix/src/util/Makefile.in b/postfix/src/util/Makefile.in index f792599c2..fc8cb29ef 100644 --- a/postfix/src/util/Makefile.in +++ b/postfix/src/util/Makefile.in @@ -646,6 +646,8 @@ inet_trigger.o: sys_defs.h inet_trigger.o: msg.h inet_trigger.o: connect.h inet_trigger.o: iostuff.h +inet_trigger.o: mymalloc.h +inet_trigger.o: events.h inet_trigger.o: trigger.h inet_util.o: inet_util.c inet_util.o: sys_defs.h @@ -834,6 +836,7 @@ safe_open.o: vstring.h safe_open.o: safe_open.h sane_accept.o: sane_accept.c sane_accept.o: sys_defs.h +sane_accept.o: msg.h sane_accept.o: sane_accept.h sane_link.o: sane_link.c sane_link.o: sys_defs.h @@ -925,6 +928,8 @@ stream_trigger.o: sys_defs.h stream_trigger.o: msg.h stream_trigger.o: connect.h stream_trigger.o: iostuff.h +stream_trigger.o: mymalloc.h +stream_trigger.o: events.h stream_trigger.o: trigger.h sys_compat.o: sys_compat.c sys_compat.o: sys_defs.h @@ -976,6 +981,8 @@ unix_trigger.o: sys_defs.h unix_trigger.o: msg.h unix_trigger.o: connect.h unix_trigger.o: iostuff.h +unix_trigger.o: mymalloc.h +unix_trigger.o: events.h unix_trigger.o: trigger.h unsafe.o: unsafe.c unsafe.o: sys_defs.h diff --git a/postfix/src/util/dict_ldap.c b/postfix/src/util/dict_ldap.c index e39fed3fb..fc3a80213 100644 --- a/postfix/src/util/dict_ldap.c +++ b/postfix/src/util/dict_ldap.c @@ -104,6 +104,10 @@ #include "dict.h" #include "dict_ldap.h" +/* AAARGH!! */ + +#include "../global/mail_conf.h" + /* * Structure containing all the configuration parameters for a given * LDAP source, plus its connection handle. diff --git a/postfix/src/util/events.c b/postfix/src/util/events.c index c07504a26..99e126956 100644 --- a/postfix/src/util/events.c +++ b/postfix/src/util/events.c @@ -32,6 +32,8 @@ /* /* void event_disable_readwrite(fd) /* int fd; +/* +/* void event_drain() /* DESCRIPTION /* This module delivers I/O and timer events. /* Multiple I/O streams and timers can be monitored simultaneously. @@ -98,6 +100,10 @@ /* event_disable_readwrite() disables further I/O events on the specified /* I/O channel. The application is allowed to cancel non-existing /* I/O event requests. +/* +/* event_drain() repeatedly calls event_loop() until no more timer +/* events or I/O events are pending. This routine must not be called +/* from an event_whatever() callback routine. /* DIAGNOSTICS /* Panics: interface violations. Fatal errors: out of memory, /* system call failure. Warnings: the number of available @@ -242,6 +248,21 @@ time_t event_time(void) return (event_present); } +/* event_drain - loop until all pending events are done */ + +void event_drain(void) +{ + fd_set zero_mask; + + if (EVENT_INIT_NEEDED()) + return; + + FD_ZERO(&zero_mask); + while (event_timer_head.pred != event_timer_head.succ + || memcmp(&zero_mask, &event_xmask, sizeof(zero_mask)) != 0) + event_loop(-1); +} + /* event_enable_read - enable read events */ void event_enable_read(int fd, EVENT_NOTIFY_RDWR callback, char *context) diff --git a/postfix/src/util/events.h b/postfix/src/util/events.h index bc39b4787..d7235093b 100644 --- a/postfix/src/util/events.h +++ b/postfix/src/util/events.h @@ -29,6 +29,7 @@ extern void event_disable_readwrite(int); extern time_t event_request_timer(EVENT_NOTIFY_TIME, char *, int); extern int event_cancel_timer(EVENT_NOTIFY_TIME, char *); extern void event_loop(int); +extern void event_drain(void); /* * Event codes. diff --git a/postfix/src/util/inet_trigger.c b/postfix/src/util/inet_trigger.c index 6907d56cd..980c22df1 100644 --- a/postfix/src/util/inet_trigger.c +++ b/postfix/src/util/inet_trigger.c @@ -16,9 +16,9 @@ /* a brief connection to it and by writing the contents of the /* named buffer. /* -/* The connection is closed by a background thread. Some kernels -/* cannot handle client-side disconnect before the server has -/* received the message. +/* The connection is closed by a background thread. Some kernels +/* cannot handle client-side disconnect before the server has +/* received the message. /* /* Arguments: /* .IP service @@ -80,6 +80,7 @@ static void inet_trigger_event(int event, char *context) if (event == EVENT_TIME) msg_warn("%s: read timeout for service %s", myname, ip->service); event_disable_readwrite(ip->fd); + event_cancel_timer(inet_trigger_event, context); if (close(ip->fd) < 0) msg_warn("%s: close %s: %m", myname, ip->service); myfree(ip->service); @@ -113,7 +114,8 @@ int inet_trigger(const char *service, const char *buf, int len, int timeout) /* * Write the request... */ - if (write_buf(fd, buf, len, timeout) < 0) + if (write_buf(fd, buf, len, timeout) < 0 + || write_buf(fd, "", 1, timeout) < 0) if (msg_verbose) msg_warn("%s: write to %s: %m", myname, service); @@ -121,7 +123,7 @@ int inet_trigger(const char *service, const char *buf, int len, int timeout) * Wakeup when the peer disconnects, or when we lose patience. */ if (timeout > 0) - event_request_timer(inet_trigger_event, (char *) ip, timeout); + event_request_timer(inet_trigger_event, (char *) ip, timeout + 100); event_enable_read(fd, inet_trigger_event, (char *) ip); return (0); } diff --git a/postfix/src/util/stream_trigger.c b/postfix/src/util/stream_trigger.c index b064a7963..31b4dae0a 100644 --- a/postfix/src/util/stream_trigger.c +++ b/postfix/src/util/stream_trigger.c @@ -77,6 +77,7 @@ static void stream_trigger_event(int event, char *context) if (event == EVENT_TIME) msg_warn("%s: read timeout for service %s", myname, sp->service); event_disable_readwrite(sp->fd); + event_cancel_timer(stream_trigger_event, context); if (close(sp->fd) < 0) msg_warn("%s: close %s: %m", myname, sp->service); myfree(sp->service); @@ -113,7 +114,8 @@ int stream_trigger(const char *service, const char *buf, int len, int timeou /* * Write the request... */ - if (write_buf(fd, buf, len, timeout) < 0) + if (write_buf(fd, buf, len, timeout) < 0 + || write_buf(fd, "", 1, timeout) < 0) if (msg_verbose) msg_warn("%s: write to %s: %m", myname, service); @@ -121,7 +123,7 @@ int stream_trigger(const char *service, const char *buf, int len, int timeou * Wakeup when the peer disconnects, or when we lose patience. */ if (timeout > 0) - event_request_timer(stream_trigger_event, (char *) sp, timeout); + event_request_timer(stream_trigger_event, (char *) sp, timeout + 100); event_enable_read(fd, stream_trigger_event, (char *) sp); return (0); } diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index dbad4d716..664b32938 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -401,6 +401,10 @@ extern int initgroups(const char *, int); #if defined(IRIX5) #define MISSING_USLEEP +#endif + +#if defined(IRIX6) +#define HAS_POSIX_REGEXP #endif /* diff --git a/postfix/src/util/unix_trigger.c b/postfix/src/util/unix_trigger.c index 0bf8ae15f..d4a341d75 100644 --- a/postfix/src/util/unix_trigger.c +++ b/postfix/src/util/unix_trigger.c @@ -78,6 +78,7 @@ static void unix_trigger_event(int event, char *context) if (event == EVENT_TIME) msg_warn("%s: read timeout for service %s", myname, up->service); event_disable_readwrite(up->fd); + event_cancel_timer(unix_trigger_event, context); if (close(up->fd) < 0) msg_warn("%s: close %s: %m", myname, up->service); myfree(up->service); @@ -114,7 +115,8 @@ int unix_trigger(const char *service, const char *buf, int len, int timeout) /* * Write the request... */ - if (write_buf(fd, buf, len, timeout) < 0) + if (write_buf(fd, buf, len, timeout) < 0 + || write_buf(fd, "", 1, timeout) < 0) if (msg_verbose) msg_warn("%s: write to %s: %m", myname, service); @@ -122,7 +124,7 @@ int unix_trigger(const char *service, const char *buf, int len, int timeout) * Wakeup when the peer disconnects, or when we lose patience. */ if (timeout > 0) - event_request_timer(unix_trigger_event, (char *) up, timeout); + event_request_timer(unix_trigger_event, (char *) up, timeout + 100); event_enable_read(fd, unix_trigger_event, (char *) up); return (0); }