From owner-postfix-announce@postfix.org Thu Mar 30 12:30:01 2000 Return-Path: Delivered-To: wietse@porcupine.org Received: from russian-caravan.cloud9.net (russian-caravan.cloud9.net [168.100.1.4]) by spike.porcupine.org (Postfix) with ESMTP id 7C0DF45630 for ; Thu, 30 Mar 2000 12:29:51 -0500 (EST) Received: by russian-caravan.cloud9.net (Postfix) id 2D2D8763AC; Thu, 30 Mar 2000 12:27:51 -0500 (EST) Delivered-To: postfix-announce-outgoing@cloud9.net Received: by russian-caravan.cloud9.net (Postfix, from userid 54) id DDD4376407; Thu, 30 Mar 2000 12:27:49 -0500 (EST) Received: from spike.porcupine.org (umbilical.porcupine.org [168.100.189.1]) by russian-caravan.cloud9.net (Postfix) with ESMTP id 9878F76407; Thu, 30 Mar 2000 12:25:55 -0500 (EST) Received: by spike.porcupine.org (Postfix, from userid 100) id 770F14565D; Thu, 30 Mar 2000 12:25:54 -0500 (EST) Subject: Postfix 19991231 patch 06 available To: postfix-announce@postfix.org (Postfix announce) Cc: postfix-users@postfix.org (Postfix users) X-Time-Zone: USA EST, 6 hours behind central European time MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20000330172554.770F14565D@spike.porcupine.org> Date: Thu, 30 Mar 2000 12:25:54 -0500 (EST) From: wietse@porcupine.org (Wietse Venema) Sender: owner-postfix-announce@postfix.org Precedence: bulk Content-Length: 48140 Status: RO Postfix version 19991231 patchlevel 06 is available. This patch consolidates last month's fixes. - Portability: HP-UX awk can't handle bare { in regexps. - Compatibility: sendmail now recognizes '.' as end of input. - Compatibility: dtcm (CDE desktop calendar manager) leaks a file descriptor into its child process, and requires that sendmail closes the descriptor, otherwise mail notification will hang. - Bugfix: settings in one mysql configuration file would act as the implicit defaults for the next one, which could be confusing. - Robustness: limit the number of "junk" commands that can be issued in an SMTP session (ex.: NOOP, VRFY, ETRN, RSET). A fully-patched version of the source code is being made available via the usual FTP servers, primary site: ftp://ftp.porcupine.org/mirrors/postfix-release/official/ Or, if you use a web browser, ftp://ftp.porcupine.org/mirrors/postfix-release/index.html Happy Postfixing. Wietse Prereq: "Postfix-19991231-pl05" diff -bcr ../postfix-19991231-pl05/global/mail_version.h ./global/mail_version.h *** ../postfix-19991231-pl05/global/mail_version.h Wed Mar 8 18:18:30 2000 --- ./global/mail_version.h Tue Mar 28 09:30:17 2000 *************** *** 15,21 **** * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19991231-pl05" extern char *var_mail_version; /* LICENSE --- 15,21 ---- * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" ! #define DEF_MAIL_VERSION "Postfix-19991231-pl06" extern char *var_mail_version; /* LICENSE diff -bcr ../postfix-19991231-pl05/HISTORY ./HISTORY *** ../postfix-19991231-pl05/HISTORY Wed Mar 8 19:02:52 2000 --- ./HISTORY Tue Mar 28 09:34:44 2000 *************** *** 3643,3645 **** --- 3643,3672 ---- when a queue file write error happened before it had written any recipients. Keith Stevenson. File: smtpd/smtpd.c. + 20000311 + + Portability: HP-UX awk can't handle bare { in regexps + (Lamont Jones. HP). File: postconf/extract.awk. + + Compatibility: sendmail now recognizes '.' as end of input. + File: sendmail/sendmail.c. + + 20000313 + + Compatibility: dtcm (CDE desktop calendar manager) leaks + a file descriptor into its child process, and requires that + sendmail closes the descriptor, otherwise mail notification + will hang. These GUI programmers never figured out that + the child process must close the writing end of a pipe. + File: sendmail/sendmail.c. + + 20000326 + + Bugfix: settings in one mysql configuration file would act + as the implicit defaults for the next one, which could be + confusing. Patch by Scott Cotton. File: util/dict_mysql.c. + + Robustness: limit the number of "junk" commands that can + be issued in an SMTP session (ex.: NOOP, VRFY, ETRN, RSET). + Problem report by Michael Ju. Tokarev @ tls.msk.ru. Files: + global/mail_params.h, smtpd/smtpd.c. diff -bcr ../postfix-19991231-pl05/INSTALL.sh ./INSTALL.sh *** ../postfix-19991231-pl05/INSTALL.sh Thu Jan 27 21:12:59 2000 --- ./INSTALL.sh Thu Mar 30 10:12:21 2000 *************** *** 47,52 **** --- 47,53 ---- compare_or_replace() { cmp $2 $3 >/dev/null 2>&1 || { + echo Updating $3... rm -f $tempdir/junk || exit 1 cp $2 $tempdir/junk || exit 1 chmod $1 $tempdir/junk || exit 1 *************** *** 57,62 **** --- 58,64 ---- compare_or_symlink() { cmp $1 $2 >/dev/null 2>&1 || { + echo Updating $2... rm -f $tempdir/junk || exit 1 dest=`echo $1 | sed ' s;^'$install_root';; *************** *** 85,90 **** --- 87,93 ---- compare_or_move() { cmp $2 $3 >/dev/null 2>&1 || { + echo Updating $3... mv -f $2 $3 || exit 1 chmod $1 $3 || exit 1 } diff -bcr ../postfix-19991231-pl05/RELEASE_NOTES ./RELEASE_NOTES *** ../postfix-19991231-pl05/RELEASE_NOTES Thu Jan 6 09:52:40 2000 --- ./RELEASE_NOTES Thu Mar 30 10:06:56 2000 *************** *** 1,3 **** --- 1,11 ---- + Incompatible changes with postfix-19991231-pl06: + ================================================ + + The Postfix sendmail command now treats a line with only `.' as + the end of input, for the sake of sendmail compatibility. To disable + this feature, specify the sendmail-compatible `-i' or `-oi' flags + on the sendmail command line. + Incompatible changes with postfix-19991231: =========================================== diff -bcr ../postfix-19991231-pl05/global/mail_params.h ./global/mail_params.h *** ../postfix-19991231-pl05/global/mail_params.h Thu Jan 27 21:05:29 2000 --- ./global/mail_params.h Sun Mar 26 17:45:16 2000 *************** *** 623,628 **** --- 623,632 ---- #define DEF_SMTPD_ERR_SLEEP 5 extern int var_smtpd_err_sleep; + #define VAR_SMTPD_JUNK_CMD "smtpd_junk_command_limit" + #define DEF_SMTPD_JUNK_CMD 1000 + extern int var_smtpd_junk_cmd_limit; + /* * Cleanup service. Header info that exceeds $header_size_limit bytes forces * the start of the message body. diff -bcr ../postfix-19991231-pl05/html/cleanup.8.html ./html/cleanup.8.html *** ../postfix-19991231-pl05/html/cleanup.8.html Thu Jan 27 19:16:12 2000 --- ./html/cleanup.8.html Thu Mar 30 10:46:16 2000 *************** *** 57,63 **** message back to the sender in case of trouble. STANDARDS ! RFC 822 (ARPA Internet Text Messages) --- 57,63 ---- message back to the sender in case of trouble. STANDARDS ! RFC 822 (ARPA Internet Text Messages) diff -bcr ../postfix-19991231-pl05/html/mailq.1.html ./html/mailq.1.html *** ../postfix-19991231-pl05/html/mailq.1.html Mon Dec 20 21:00:58 1999 --- ./html/mailq.1.html Thu Mar 30 10:46:17 2000 *************** *** 24,34 **** options are recognized but silently ignored. By default, sendmail reads a message from standard input ! and arranges for delivery. sendmail attempts to create a ! queue file in the maildrop directory. If that directory is ! not world-writable, the message is piped through the post- ! drop(1) command, which is expected to execute with suit- ! able privileges. Specific command aliases are provided for other common modes of operation: --- 24,35 ---- options are recognized but silently ignored. By default, sendmail reads a message from standard input ! until EOF or until it reads a line with only a . charac- ! ter, and arranges for delivery. sendmail attempts to cre- ! ate a queue file in the maildrop directory. If that direc- ! tory is not world-writable, the message is piped through ! the postdrop(1) command, which is expected to execute with ! suitable privileges. Specific command aliases are provided for other common modes of operation: *************** *** 57,64 **** These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf configu- ! ration file. --- 58,64 ---- These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf *************** *** 71,76 **** --- 71,78 ---- SENDMAIL(1) SENDMAIL(1) + configuration file. + The following options are recognized: -B body_type (ignored) *************** *** 126,133 **** - - 2 --- 128,133 ---- *************** *** 141,149 **** Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i (ignored) ! Lines beginning with "." get special treatment only ! with -bs. -m (ignored) Backwards compatibility. --- 141,149 ---- Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i When reading a message from standard input, don't ! treat a line with only a . character as the end of ! input. -m (ignored) Backwards compatibility. *************** *** 161,166 **** --- 161,170 ---- The message body type. Currently, Postfix imple- ments just-send-eight. + -oi When reading a message from standard input, don't + treat a line with only a . character as the end of + input. + -om (ignored) The sender is never eliminated from alias etc. expansions. *************** *** 187,196 **** -v Enable verbose logging for debugging purposes. Mul- tiple -v options make the software increasingly - verbose. - - SECURITY - By design, this program is not set-user (or group) id. --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + verbose. + + SECURITY + By design, this program is not set-user (or group) id. However, it must handle data from untrusted users or untrusted machines. Thus, the usual precautions need to be taken against malicious inputs. *************** *** 254,263 **** host matches a pattern in the debug_peer_list parameter. - debug_peer_list - List of domain or network patterns. When a remote - host matches a pattern, increase the verbose - 4 --- 258,263 ---- *************** *** 269,275 **** SENDMAIL(1) SENDMAIL(1) ! logging level by the amount specified in the debug_peer_level parameter. fork_attempts --- 269,278 ---- SENDMAIL(1) SENDMAIL(1) ! debug_peer_list ! List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the debug_peer_level parameter. fork_attempts *************** *** 319,328 **** The Secure Mailer license must be distributed with this software. ! AUTHOR(S) ! Wietse Venema ! IBM T.J. Watson Research ! P.O. Box 704 --- 322,328 ---- The Secure Mailer license must be distributed with this software. ! *************** *** 335,345 **** SENDMAIL(1) SENDMAIL(1) Yorktown Heights, NY 10598, USA - - - - --- 335,345 ---- SENDMAIL(1) SENDMAIL(1) + AUTHOR(S) + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 Yorktown Heights, NY 10598, USA diff -bcr ../postfix-19991231-pl05/html/newaliases.1.html ./html/newaliases.1.html *** ../postfix-19991231-pl05/html/newaliases.1.html Mon Dec 20 21:00:58 1999 --- ./html/newaliases.1.html Thu Mar 30 10:46:17 2000 *************** *** 24,34 **** options are recognized but silently ignored. By default, sendmail reads a message from standard input ! and arranges for delivery. sendmail attempts to create a ! queue file in the maildrop directory. If that directory is ! not world-writable, the message is piped through the post- ! drop(1) command, which is expected to execute with suit- ! able privileges. Specific command aliases are provided for other common modes of operation: --- 24,35 ---- options are recognized but silently ignored. By default, sendmail reads a message from standard input ! until EOF or until it reads a line with only a . charac- ! ter, and arranges for delivery. sendmail attempts to cre- ! ate a queue file in the maildrop directory. If that direc- ! tory is not world-writable, the message is piped through ! the postdrop(1) command, which is expected to execute with ! suitable privileges. Specific command aliases are provided for other common modes of operation: *************** *** 57,64 **** These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf configu- ! ration file. --- 58,64 ---- These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf *************** *** 71,76 **** --- 71,78 ---- SENDMAIL(1) SENDMAIL(1) + configuration file. + The following options are recognized: -B body_type (ignored) *************** *** 126,133 **** - - 2 --- 128,133 ---- *************** *** 141,149 **** Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i (ignored) ! Lines beginning with "." get special treatment only ! with -bs. -m (ignored) Backwards compatibility. --- 141,149 ---- Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i When reading a message from standard input, don't ! treat a line with only a . character as the end of ! input. -m (ignored) Backwards compatibility. *************** *** 161,166 **** --- 161,170 ---- The message body type. Currently, Postfix imple- ments just-send-eight. + -oi When reading a message from standard input, don't + treat a line with only a . character as the end of + input. + -om (ignored) The sender is never eliminated from alias etc. expansions. *************** *** 187,196 **** -v Enable verbose logging for debugging purposes. Mul- tiple -v options make the software increasingly - verbose. - - SECURITY - By design, this program is not set-user (or group) id. --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + verbose. + + SECURITY + By design, this program is not set-user (or group) id. However, it must handle data from untrusted users or untrusted machines. Thus, the usual precautions need to be taken against malicious inputs. *************** *** 254,263 **** host matches a pattern in the debug_peer_list parameter. - debug_peer_list - List of domain or network patterns. When a remote - host matches a pattern, increase the verbose - 4 --- 258,263 ---- *************** *** 269,275 **** SENDMAIL(1) SENDMAIL(1) ! logging level by the amount specified in the debug_peer_level parameter. fork_attempts --- 269,278 ---- SENDMAIL(1) SENDMAIL(1) ! debug_peer_list ! List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the debug_peer_level parameter. fork_attempts *************** *** 319,328 **** The Secure Mailer license must be distributed with this software. ! AUTHOR(S) ! Wietse Venema ! IBM T.J. Watson Research ! P.O. Box 704 --- 322,328 ---- The Secure Mailer license must be distributed with this software. ! *************** *** 335,345 **** SENDMAIL(1) SENDMAIL(1) Yorktown Heights, NY 10598, USA - - - - --- 335,345 ---- SENDMAIL(1) SENDMAIL(1) + AUTHOR(S) + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 Yorktown Heights, NY 10598, USA diff -bcr ../postfix-19991231-pl05/html/sendmail.1.html ./html/sendmail.1.html *** ../postfix-19991231-pl05/html/sendmail.1.html Mon Dec 20 21:00:58 1999 --- ./html/sendmail.1.html Thu Mar 30 10:46:17 2000 *************** *** 24,34 **** options are recognized but silently ignored. By default, sendmail reads a message from standard input ! and arranges for delivery. sendmail attempts to create a ! queue file in the maildrop directory. If that directory is ! not world-writable, the message is piped through the post- ! drop(1) command, which is expected to execute with suit- ! able privileges. Specific command aliases are provided for other common modes of operation: --- 24,35 ---- options are recognized but silently ignored. By default, sendmail reads a message from standard input ! until EOF or until it reads a line with only a . charac- ! ter, and arranges for delivery. sendmail attempts to cre- ! ate a queue file in the maildrop directory. If that direc- ! tory is not world-writable, the message is piped through ! the postdrop(1) command, which is expected to execute with ! suitable privileges. Specific command aliases are provided for other common modes of operation: *************** *** 57,64 **** These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf configu- ! ration file. --- 58,64 ---- These and other features can be selected by specifying the appropriate combination of command-line options. Some fea- ! tures are controlled by parameters in the main.cf *************** *** 71,76 **** --- 71,78 ---- SENDMAIL(1) SENDMAIL(1) + configuration file. + The following options are recognized: -B body_type (ignored) *************** *** 126,133 **** - - 2 --- 128,133 ---- *************** *** 141,149 **** Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i (ignored) ! Lines beginning with "." get special treatment only ! with -bs. -m (ignored) Backwards compatibility. --- 141,149 ---- Hop count limit. Use the hopcount_limit configura- tion parameter instead. ! -i When reading a message from standard input, don't ! treat a line with only a . character as the end of ! input. -m (ignored) Backwards compatibility. *************** *** 161,166 **** --- 161,170 ---- The message body type. Currently, Postfix imple- ments just-send-eight. + -oi When reading a message from standard input, don't + treat a line with only a . character as the end of + input. + -om (ignored) The sender is never eliminated from alias etc. expansions. *************** *** 187,196 **** -v Enable verbose logging for debugging purposes. Mul- tiple -v options make the software increasingly - verbose. - - SECURITY - By design, this program is not set-user (or group) id. --- 191,196 ---- *************** *** 203,208 **** --- 203,212 ---- SENDMAIL(1) SENDMAIL(1) + verbose. + + SECURITY + By design, this program is not set-user (or group) id. However, it must handle data from untrusted users or untrusted machines. Thus, the usual precautions need to be taken against malicious inputs. *************** *** 254,263 **** host matches a pattern in the debug_peer_list parameter. - debug_peer_list - List of domain or network patterns. When a remote - host matches a pattern, increase the verbose - 4 --- 258,263 ---- *************** *** 269,275 **** SENDMAIL(1) SENDMAIL(1) ! logging level by the amount specified in the debug_peer_level parameter. fork_attempts --- 269,278 ---- SENDMAIL(1) SENDMAIL(1) ! debug_peer_list ! List of domain or network patterns. When a remote ! host matches a pattern, increase the verbose log- ! ging level by the amount specified in the debug_peer_level parameter. fork_attempts *************** *** 319,328 **** The Secure Mailer license must be distributed with this software. ! AUTHOR(S) ! Wietse Venema ! IBM T.J. Watson Research ! P.O. Box 704 --- 322,328 ---- The Secure Mailer license must be distributed with this software. ! *************** *** 335,345 **** SENDMAIL(1) SENDMAIL(1) Yorktown Heights, NY 10598, USA - - - - --- 335,345 ---- SENDMAIL(1) SENDMAIL(1) + AUTHOR(S) + Wietse Venema + IBM T.J. Watson Research + P.O. Box 704 Yorktown Heights, NY 10598, USA diff -bcr ../postfix-19991231-pl05/html/smtpd.8.html ./html/smtpd.8.html *** ../postfix-19991231-pl05/html/smtpd.8.html Thu Jan 27 19:16:13 2000 --- ./html/smtpd.8.html Thu Mar 30 10:46:17 2000 *************** *** 36,48 **** SMTP server can be run chrooted at fixed low privilege. STANDARDS ! RFC 821 (SMTP protocol) ! RFC 1123 (Host requirements) ! RFC 1651 (SMTP service extensions) ! RFC 1652 (8bit-MIME transport) ! RFC 1854 (SMTP Pipelining) ! RFC 1870 (Message Size Declaration) ! RFC 1985 (ETRN command) (partial) DIAGNOSTICS Problems and transactions are logged to syslogd(8). --- 36,48 ---- SMTP server can be run chrooted at fixed low privilege. STANDARDS ! RFC 821 (SMTP protocol) ! RFC 1123 (Host requirements) ! RFC 1651 (SMTP service extensions) ! RFC 1652 (8bit-MIME transport) ! RFC 1854 (SMTP Pipelining) ! RFC 1870 (Message Size Declaration) ! RFC 1985 (ETRN command) (partial) DIAGNOSTICS Problems and transactions are logged to syslogd(8). *************** *** 52,58 **** policy violations, and of other trouble. BUGS ! RFC 1985 is implemented by forcing delivery of all deferred mail. CONFIGURATION PARAMETERS --- 52,58 ---- policy violations, and of other trouble. BUGS ! RFC 1985 is implemented by forcing delivery of all deferred mail. CONFIGURATION PARAMETERS *************** *** 75,82 **** Compatibility controls strict_rfc821_envelopes ! Disallow non-RFC 821 style addresses in envelopes. ! For example, allow RFC822-style address forms with comments, like Sendmail does. Miscellaneous --- 75,82 ---- Compatibility controls strict_rfc821_envelopes ! Disallow non-RFC 821 style addresses in envelopes. ! For example, allow RFC822-style address forms with comments, like Sendmail does. Miscellaneous *************** *** 177,182 **** --- 177,188 ---- Disconnect after a client has made this number of errors. + smtpd_junk_command_limit + Limit the number of times a client can issue a junk + command such as NOOP, VRFY, ETRN or RSET in one + SMTP session before it is penalized with tarpit + delays. + UCE control restrictions smtpd_client_restrictions Restrict what clients may connect to this mail sys- *************** *** 186,197 **** Require that clients introduce themselves at the beginning of an SMTP session. - smtpd_helo_restrictions - Restrict what client hostnames are allowed in HELO - and EHLO commands. - - - 3 --- 192,197 ---- *************** *** 203,208 **** --- 203,212 ---- SMTPD(8) SMTPD(8) + smtpd_helo_restrictions + Restrict what client hostnames are allowed in HELO + and EHLO commands. + smtpd_sender_restrictions Restrict what sender addresses are allowed in MAIL FROM commands. *************** *** 252,261 **** Response code when the client matches a reject restriction. - relay_domains_reject_code - Server response when a client attempts to violate - the mail relay policy. - --- 256,261 ---- *************** *** 269,274 **** --- 269,278 ---- SMTPD(8) SMTPD(8) + relay_domains_reject_code + Server response when a client attempts to violate + the mail relay policy. + unknown_address_reject_code Server response when a client violates the reject_unknown_address restriction. *************** *** 296,305 **** IBM T.J. Watson Research P.O. Box 704 Yorktown Heights, NY 10598, USA - - - - --- 300,305 ---- diff -bcr ../postfix-19991231-pl05/man/man1/sendmail.1 ./man/man1/sendmail.1 *** ../postfix-19991231-pl05/man/man1/sendmail.1 Mon Dec 20 21:00:51 1999 --- ./man/man1/sendmail.1 Thu Mar 30 10:46:10 2000 *************** *** 24,29 **** --- 24,30 ---- Sendmail command-line options are recognized but silently ignored. By default, \fBsendmail\fR reads a message from standard input + until EOF or until it reads a line with only a \fB.\fR character, and arranges for delivery. \fBsendmail\fR attempts to create a queue file in the \fBmaildrop\fR directory. If that directory is not world-writable, the message is piped through the *************** *** 101,108 **** .IP "\fB-h \fIhop_count\fR (ignored)" Hop count limit. Use the \fBhopcount_limit\fR configuration parameter instead. ! .IP "\fB-i\fR (ignored)" ! Lines beginning with "." get special treatment only with \fB-bs\fR. .IP "\fB-m\fR (ignored)" Backwards compatibility. .IP "\fB-n\fR (ignored)" --- 102,110 ---- .IP "\fB-h \fIhop_count\fR (ignored)" Hop count limit. Use the \fBhopcount_limit\fR configuration parameter instead. ! .IP "\fB-i\fR" ! When reading a message from standard input, don\'t treat a line ! with only a \fB.\fR character as the end of input. .IP "\fB-m\fR (ignored)" Backwards compatibility. .IP "\fB-n\fR (ignored)" *************** *** 115,120 **** --- 117,125 ---- .IP "\fB-o8\fR (ignored)" The message body type. Currently, Postfix implements \fBjust-send-eight\fR. + .IP "\fB-oi\fR" + When reading a message from standard input, don\'t treat a line + with only a \fB.\fR character as the end of input. .IP "\fB-om\fR (ignored)" The sender is never eliminated from alias etc. expansions. .IP "\fB-o \fIx value\fR (ignored)" diff -bcr ../postfix-19991231-pl05/man/man8/smtpd.8 ./man/man8/smtpd.8 *** ../postfix-19991231-pl05/man/man8/smtpd.8 Thu Jan 27 19:16:03 2000 --- ./man/man8/smtpd.8 Thu Mar 30 10:46:10 2000 *************** *** 139,144 **** --- 139,148 ---- \fIerror_count\fR seconds before responding to any client request. .IP \fBsmtpd_hard_error_limit\fR Disconnect after a client has made this number of errors. + .IP \fBsmtpd_junk_command_limit\fR + Limit the number of times a client can issue a junk command + such as NOOP, VRFY, ETRN or RSET in one SMTP session before + it is penalized with tarpit delays. .SH "UCE control restrictions" .ad .fi diff -bcr ../postfix-19991231-pl05/postconf/extract.awk ./postconf/extract.awk *** ../postfix-19991231-pl05/postconf/extract.awk Wed Mar 8 18:40:43 2000 --- ./postconf/extract.awk Sun Mar 26 16:54:41 2000 *************** *** 1,18 **** # Extract initialization tables from actual source code. ! /^(static| )*CONFIG_INT_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "int_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >int_table.h" } } ! /^(static| )*CONFIG_STR_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "char *" substr($3,2,length($3)-2) ";" > "str_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >str_table.h" } } ! /^(static| )*CONFIG_BOOL_TABLE .*{/,/};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "bool_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >bool_table.h" --- 1,18 ---- # Extract initialization tables from actual source code. ! /^(static| )*CONFIG_INT_TABLE .*\{/,/\};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "int_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >int_table.h" } } ! /^(static| )*CONFIG_STR_TABLE .*\{/,/\};/ { if ($1 ~ /VAR/) { print "char *" substr($3,2,length($3)-2) ";" > "str_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >str_table.h" } } ! /^(static| )*CONFIG_BOOL_TABLE .*\{/,/\};/ { if ($1 ~ /VAR/) { print "int " substr($3,2,length($3)-2) ";" > "bool_vars.h" print | "sed 's/[ ][ ]*/ /g' | sort -u >bool_table.h" diff -bcr ../postfix-19991231-pl05/sendmail/sendmail.c ./sendmail/sendmail.c *** ../postfix-19991231-pl05/sendmail/sendmail.c Thu Dec 16 21:19:52 1999 --- ./sendmail/sendmail.c Sun Mar 26 15:51:33 2000 *************** *** 18,23 **** --- 18,24 ---- /* Sendmail command-line options are recognized but silently ignored. /* /* By default, \fBsendmail\fR reads a message from standard input + /* until EOF or until it reads a line with only a \fB.\fR character, /* and arranges for delivery. \fBsendmail\fR attempts to create /* a queue file in the \fBmaildrop\fR directory. If that directory /* is not world-writable, the message is piped through the *************** *** 95,102 **** /* .IP "\fB-h \fIhop_count\fR (ignored)" /* Hop count limit. Use the \fBhopcount_limit\fR configuration /* parameter instead. ! /* .IP "\fB-i\fR (ignored)" ! /* Lines beginning with "." get special treatment only with \fB-bs\fR. /* .IP "\fB-m\fR (ignored)" /* Backwards compatibility. /* .IP "\fB-n\fR (ignored)" --- 96,104 ---- /* .IP "\fB-h \fIhop_count\fR (ignored)" /* Hop count limit. Use the \fBhopcount_limit\fR configuration /* parameter instead. ! /* .IP "\fB-i\fR" ! /* When reading a message from standard input, don\'t treat a line ! /* with only a \fB.\fR character as the end of input. /* .IP "\fB-m\fR (ignored)" /* Backwards compatibility. /* .IP "\fB-n\fR (ignored)" *************** *** 109,114 **** --- 111,119 ---- /* .IP "\fB-o8\fR (ignored)" /* The message body type. Currently, Postfix implements /* \fBjust-send-eight\fR. + /* .IP "\fB-oi\fR" + /* When reading a message from standard input, don\'t treat a line + /* with only a \fB.\fR character as the end of input. /* .IP "\fB-om\fR (ignored)" /* The sender is never eliminated from alias etc. expansions. /* .IP "\fB-o \fIx value\fR (ignored)" *************** *** 286,298 **** static void sendmail_cleanup(void); /* * Silly little macros (SLMs). */ #define STR vstring_str /* enqueue - post one message */ ! static void enqueue(const char *sender, const char *full_name, char **recipients) { VSTRING *buf; VSTREAM *dst; --- 291,311 ---- static void sendmail_cleanup(void); /* + * Flag parade. + */ + #define SM_FLAG_AEOF (1<<0) /* archaic EOF */ + + #define SM_FLAG_DEFAULT (SM_FLAG_AEOF) + + /* * Silly little macros (SLMs). */ #define STR vstring_str /* enqueue - post one message */ ! static void enqueue(const int flags, const char *sender, const char *full_name, ! char **recipients) { VSTRING *buf; VSTREAM *dst; *************** *** 425,430 **** --- 438,445 ---- if (strip_cr == STRIP_CR_DO && type == REC_TYPE_NORM) if (VSTRING_LEN(buf) > 0 && vstring_end(buf)[-1] == '\r') vstring_truncate(buf, VSTRING_LEN(buf) - 1); + if ((flags & SM_FLAG_AEOF) && VSTRING_LEN(buf) == 1 && *STR(buf) == '.') + break; if (REC_PUT_BUF(dst, type, buf) < 0) msg_fatal("%s(%d): error writing queue file: %m", saved_sender, uid); } *************** *** 572,577 **** --- 587,593 ---- int debug_me = 0; int err; int n; + int flags = SM_FLAG_DEFAULT; /* * Be consistent with file permissions. *************** *** 589,594 **** --- 605,618 ---- msg_fatal("open /dev/null: %m"); /* + * The CDE desktop calendar manager leaks a parent file descriptor into + * the child process. For the sake of sendmail compatibility we have to + * close the file descriptor otherwise mail notification will hang. + */ + for ( /* void */ ; fd < 100; fd++) + (void) close(fd); + + /* * Process environment options as early as we can. We might be called * from a set-uid (set-gid) program, so be careful with importing * environment variables. *************** *** 720,725 **** --- 744,752 ---- case 'f': sender = optarg; break; + case 'i': + flags &= ~SM_FLAG_AEOF; + break; case 'o': switch (*optarg) { default: *************** *** 735,740 **** --- 762,771 ---- break; case '7': case '8': + break; + case 'i': + flags &= ~SM_FLAG_AEOF; + break; case 'm': break; } *************** *** 780,786 **** msg_panic("unknown operation mode: %d", mode); /* NOTREACHED */ case SM_MODE_ENQUEUE: ! enqueue(sender, full_name, argv + OPTIND); exit(0); break; case SM_MODE_MAILQ: --- 811,817 ---- msg_panic("unknown operation mode: %d", mode); /* NOTREACHED */ case SM_MODE_ENQUEUE: ! enqueue(flags, sender, full_name, argv + OPTIND); exit(0); break; case SM_MODE_MAILQ: diff -bcr ../postfix-19991231-pl05/smtpd/smtpd.c ./smtpd/smtpd.c *** ../postfix-19991231-pl05/smtpd/smtpd.c Wed Mar 8 18:48:58 2000 --- ./smtpd/smtpd.c Sun Mar 26 17:58:22 2000 *************** *** 123,128 **** --- 123,132 ---- /* \fIerror_count\fR seconds before responding to any client request. /* .IP \fBsmtpd_hard_error_limit\fR /* Disconnect after a client has made this number of errors. + /* .IP \fBsmtpd_junk_command_limit\fR + /* Limit the number of times a client can issue a junk command + /* such as NOOP, VRFY, ETRN or RSET in one SMTP session before + /* it is penalized with tarpit delays. /* .SH "UCE control restrictions" /* .ad /* .fi *************** *** 306,311 **** --- 310,316 ---- char *var_alias_maps; char *var_local_rcpt_maps; bool var_allow_untrust_route; + int var_smtpd_junk_cmd_limit; /* * Global state, for stand-alone mode queue file cleanup. When this is *************** *** 1050,1068 **** typedef struct SMTPD_CMD { char *name; int (*action) (SMTPD_STATE *, int, SMTPD_TOKEN *); } SMTPD_CMD; static SMTPD_CMD smtpd_cmd_table[] = { ! "HELO", helo_cmd, ! "EHLO", ehlo_cmd, ! "MAIL", mail_cmd, ! "RCPT", rcpt_cmd, ! "DATA", data_cmd, ! "RSET", rset_cmd, ! "NOOP", noop_cmd, ! "VRFY", vrfy_cmd, ! "ETRN", etrn_cmd, ! "QUIT", quit_cmd, 0, }; --- 1055,1076 ---- typedef struct SMTPD_CMD { char *name; int (*action) (SMTPD_STATE *, int, SMTPD_TOKEN *); + int flags; } SMTPD_CMD; + #define SMTPD_CMD_FLAG_LIMIT (1<<0) /* limit usage */ + static SMTPD_CMD smtpd_cmd_table[] = { ! "HELO", helo_cmd, 0, ! "EHLO", ehlo_cmd, 0, ! "MAIL", mail_cmd, 0, ! "RCPT", rcpt_cmd, 0, ! "DATA", data_cmd, 0, ! "RSET", rset_cmd, SMTPD_CMD_FLAG_LIMIT, ! "NOOP", noop_cmd, SMTPD_CMD_FLAG_LIMIT, ! "VRFY", vrfy_cmd, SMTPD_CMD_FLAG_LIMIT, ! "ETRN", etrn_cmd, SMTPD_CMD_FLAG_LIMIT, ! "QUIT", quit_cmd, 0, 0, }; *************** *** 1142,1147 **** --- 1150,1158 ---- state->where = cmdp->name; if (cmdp->action(state, argc, argv) != 0) state->error_count++; + if ((cmdp->flags & SMTPD_CMD_FLAG_LIMIT) + && state->junk_cmds++ > var_smtpd_junk_cmd_limit) + state->error_count++; if (cmdp->action == quit_cmd) break; *************** *** 1321,1326 **** --- 1332,1338 ---- VAR_REJECT_CODE, DEF_REJECT_CODE, &var_reject_code, 0, 0, VAR_SMTPD_ERR_SLEEP, DEF_SMTPD_ERR_SLEEP, &var_smtpd_err_sleep, 0, 0, VAR_NON_FQDN_CODE, DEF_NON_FQDN_CODE, &var_non_fqdn_code, 0, 0, + VAR_SMTPD_JUNK_CMD, DEF_SMTPD_JUNK_CMD, &var_smtpd_junk_cmd_limit, 1, 0, 0, }; static CONFIG_BOOL_TABLE bool_table[] = { diff -bcr ../postfix-19991231-pl05/smtpd/smtpd.h ./smtpd/smtpd.h *** ../postfix-19991231-pl05/smtpd/smtpd.h Sat Nov 20 19:41:44 1999 --- ./smtpd/smtpd.h Sun Mar 26 17:41:59 2000 *************** *** 52,57 **** --- 52,58 ---- char *protocol; char *where; int recursion; + int junk_cmds; } SMTPD_STATE; extern void smtpd_state_init(SMTPD_STATE *, VSTREAM *); diff -bcr ../postfix-19991231-pl05/smtpd/smtpd_state.c ./smtpd/smtpd_state.c *** ../postfix-19991231-pl05/smtpd/smtpd_state.c Sat Nov 20 19:42:33 1999 --- ./smtpd/smtpd_state.c Sun Mar 26 17:43:05 2000 *************** *** 86,91 **** --- 86,92 ---- state->protocol = "SMTP"; state->where = SMTPD_AFTER_CONNECT; state->recursion = 0; + state->junk_cmds = 0; /* * Initialize peer information. diff -bcr ../postfix-19991231-pl05/util/dict_mysql.c ./util/dict_mysql.c *** ../postfix-19991231-pl05/util/dict_mysql.c Thu Dec 9 17:02:25 1999 --- ./util/dict_mysql.c Sun Mar 26 14:24:36 2000 *************** *** 361,379 **** int i; char *nameval; char *hosts; MYSQL_NAME *name = (MYSQL_NAME *) mymalloc(sizeof(MYSQL_NAME)); ARGV *hosts_argv; ! dict_load_file("mysql_options", mysqlcf_path); /* mysql username lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "user")) == NULL) name->username = mystrdup(""); else name->username = mystrdup(nameval); if (msg_verbose) msg_info("mysqlname_parse(): set username to '%s'", name->username); /* password lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "password")) == NULL) name->password = mystrdup(""); else name->password = mystrdup(nameval); --- 361,380 ---- int i; char *nameval; char *hosts; + /* the name of the dict for processing the mysql options file */ MYSQL_NAME *name = (MYSQL_NAME *) mymalloc(sizeof(MYSQL_NAME)); ARGV *hosts_argv; ! dict_load_file(mysqlcf_path, mysqlcf_path); /* mysql username lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "user")) == NULL) name->username = mystrdup(""); else name->username = mystrdup(nameval); if (msg_verbose) msg_info("mysqlname_parse(): set username to '%s'", name->username); /* password lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "password")) == NULL) name->password = mystrdup(""); else name->password = mystrdup(nameval); *************** *** 381,387 **** msg_info("mysqlname_parse(): set password to '%s'", name->password); /* database name lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "dbname")) == NULL) msg_fatal("%s: mysql options file does not include database name", mysqlcf_path); else name->dbname = mystrdup(nameval); --- 382,388 ---- msg_info("mysqlname_parse(): set password to '%s'", name->password); /* database name lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "dbname")) == NULL) msg_fatal("%s: mysql options file does not include database name", mysqlcf_path); else name->dbname = mystrdup(nameval); *************** *** 389,395 **** msg_info("mysqlname_parse(): set database name to '%s'", name->dbname); /* table lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "table")) == NULL) msg_fatal("%s: mysql options file does not include table name", mysqlcf_path); else name->table = mystrdup(nameval); --- 390,396 ---- msg_info("mysqlname_parse(): set database name to '%s'", name->dbname); /* table lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "table")) == NULL) msg_fatal("%s: mysql options file does not include table name", mysqlcf_path); else name->table = mystrdup(nameval); *************** *** 397,403 **** msg_info("mysqlname_parse(): set table name to '%s'", name->table); /* select field lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "select_field")) == NULL) msg_fatal("%s: mysql options file does not include select field", mysqlcf_path); else name->select_field = mystrdup(nameval); --- 398,404 ---- msg_info("mysqlname_parse(): set table name to '%s'", name->table); /* select field lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "select_field")) == NULL) msg_fatal("%s: mysql options file does not include select field", mysqlcf_path); else name->select_field = mystrdup(nameval); *************** *** 405,411 **** msg_info("mysqlname_parse(): set select_field to '%s'", name->select_field); /* where field lookup */ ! if ((nameval = (char *) dict_lookup("mysql_options", "where_field")) == NULL) msg_fatal("%s: mysql options file does not include where field", mysqlcf_path); else name->where_field = mystrdup(nameval); --- 406,412 ---- msg_info("mysqlname_parse(): set select_field to '%s'", name->select_field); /* where field lookup */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "where_field")) == NULL) msg_fatal("%s: mysql options file does not include where field", mysqlcf_path); else name->where_field = mystrdup(nameval); *************** *** 413,419 **** msg_info("mysqlname_parse(): set where_field to '%s'", name->where_field); /* additional conditions */ ! if ((nameval = (char *) dict_lookup("mysql_options", "additional_conditions")) == NULL) name->additional_conditions = mystrdup(""); else name->additional_conditions = mystrdup(nameval); --- 414,420 ---- msg_info("mysqlname_parse(): set where_field to '%s'", name->where_field); /* additional conditions */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "additional_conditions")) == NULL) name->additional_conditions = mystrdup(""); else name->additional_conditions = mystrdup(nameval); *************** *** 421,427 **** msg_info("mysqlname_parse(): set additional_conditions to '%s'", name->additional_conditions); /* mysql server hosts */ ! if ((nameval = (char *) dict_lookup("mysql_options", "hosts")) == NULL) hosts = mystrdup(""); else hosts = mystrdup(nameval); --- 422,428 ---- msg_info("mysqlname_parse(): set additional_conditions to '%s'", name->additional_conditions); /* mysql server hosts */ ! if ((nameval = (char *) dict_lookup(mysqlcf_path, "hosts")) == NULL) hosts = mystrdup(""); else hosts = mystrdup(nameval);