]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-20010228-pl03 v20010228-pl03
authorWietse Venema <wietse@porcupine.org>
Sat, 26 May 2001 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 15:51:30 +0000 (15:51 +0000)
20 files changed:
postfix/HISTORY
postfix/INSTALL.sh
postfix/SASL_README
postfix/conf/main.cf
postfix/conf/sample-ldap.cf
postfix/conf/sample-misc.cf
postfix/conf/sample-smtpd.cf
postfix/html/faq.html
postfix/src/global/mail_conf_bool.c
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp.c
postfix/src/lmtp/lmtp_proto.c
postfix/src/postsuper/postsuper.c
postfix/src/sendmail/sendmail.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtpd/smtpd.c
postfix/src/smtpd/smtpd_check.c
postfix/src/util/dict_ldap.c
postfix/src/util/sane_link.c
postfix/src/util/writable.c

index f8b7c367cfb9c32da7471cd71fc9ca5b72c6fe62..13a9bcfad5714985c8bda07180760b547c0818dc 100644 (file)
@@ -5024,3 +5024,42 @@ Apologies for any names omitted.
        a 4xx temporary error code when, for example, an LDAP or
        mysql server was unavailable. Remotely based on a fix by
        Robert Kiessling @ de.easynet.net. File: smtpd/smtpd_check.c.
+
+20010501
+
+       Bugfix: The SMTP server's 550 in reply to DATA should be
+       a 554 response.  And it wasn't Sendmail. Claus Assman.
+
+       Bugfix: the INSTALL.sh test for non-interactive upgrade
+       broke rooted installations that specify settings via the
+       environment.  Simon Mudd.
+
+       Bugfix: mailq output is now really flushed one message at
+       a time. File: sendmail/sendmail.c.
+
+20010507
+
+       Bugfix: with soft_bounce=yes, the SMTP server would log
+       5xx replies even though it would send 4xx replies to the
+       client (Phil Howard, ipal.net). File: smtpd/smtpd_check.c.
+
+20010523
+
+       Bugfix: postsuper's temporary file detection logic needed
+       fixing.
+
+       Bugfix: memory leak in the LDAP client module. Alain
+       Thivillon, France Teaser - Groupe Firstream.
+
+20010525
+
+       Bugfix: the SMTP and LMTP clients claimed that a queue file
+       needed to be delivered again (even when all recipients were
+       erased from the queue file) when no QUIT or RSET reply was
+       received (by default, this does not happen with SMTP mail
+       because the SMTP client does not wait for QUIT replies and
+       does not send RSET to deliver mail).  As a result of the
+       same bug the LMTP client followed a dangling pointer when
+       sending QUIT after process idle timeout while the LMTP
+       server had disconnected.  Files:  smtp/smtp_proto.c,
+       lmtp/lmtp_proto.c.
index 88a60495d9b0d170532d70ef15c82f7599dabcac..391b45084dc9e8b474474bfff468236c4aed8c6b 100644 (file)
@@ -166,15 +166,17 @@ test -f $CONFIG_DIRECTORY/main.cf && {
     done
 }
 
-test -f $CONFIG_DIRECTORY/install.cf && . $CONFIG_DIRECTORY/install.cf || {
-    test -t 0 || {
-       echo Non-interactive install needs the $CONFIG_DIRECTORY/install.cf 1>&2
-       echo file from a previous Postfix installation. 1>&2
-       echo 1>&2
-       echo Use interactive installation instead. 1>&2
-       exit 1
-    }
-}
+if [ -f $CONFIG_DIRECTORY/install.cf ]
+then
+    . $CONFIG_DIRECTORY/install.cf
+elif [ ! -t 0 -a -z "$install_root" ]
+then
+    echo Non-interactive install needs the $CONFIG_DIRECTORY/install.cf 1>&2
+    echo file from a previous Postfix installation. 1>&2
+    echo 1>&2
+    echo Use interactive installation instead. 1>&2
+    exit 1
+fi
 
 # Override default settings.
 
index a976da9c8ac38b39c985de5762a0049df0ec5932..e334ca9fc0f06cc07d9c31a31294a0b830c7f85a 100644 (file)
@@ -186,6 +186,16 @@ remote part of an email address).
        foo.com         username:password
        bar.com         username
 
+Note: some SMTP servers support PLAIN or LOGIN authentication only.
+By default, the Postfix SMTP client does not use authentication
+methods that send plaintext passwords, and defers delivery with
+the following error message:  "Authentication failed: cannot SASL
+authenticate to server". To enable plaintext authentication specify,
+for example:
+
+    /etc/postfix/main.cf:
+       smtp_sasl_security_options = 
+
 The SASL client password file is opened before the SMTP server
 enters the optional chroot jail, so you can keep the file in
 /etc/postfix.
index 03406031852d1d46955fd7b5bac2b33c1b6fa58e..1612b1d45463b8873979af14eb6539b5179be1cd 100644 (file)
@@ -98,8 +98,10 @@ mail_owner = postfix
 #inet_interfaces = $myhostname, localhost
 
 # The mydestination parameter specifies the list of domains that this
-# machine considers itself the final destination for. That does not
-# include domains that are hosted on this machine. Those domains are
+# machine considers itself the final destination for. That includes
+# Sendmail-style virtual domains hosted on this machine.
+#
+# Do not include Postfix-style virtual domains - those domains are
 # specified elsewhere (see sample-virtual.cf, and sample-transport.cf).
 #
 # The default is $myhostname + localhost.$mydomain.  On a mail domain
index 4f8a504d6078d6fff92c5e6b1d289df67a1e18b6..c503df0bc66cee434b9d6ef14a95563f540a27c7 100644 (file)
@@ -5,8 +5,8 @@
 # parameters that control LDAP lookups. Source code for LDAP
 # lookup is available separately from http://www.postfix.org/
 
-# The ldap_lookup_timeout parameter specifies the timeout for LDAP
-# database lookups.
+# The ldap_timeout parameter specifies the timeout for LDAP database
+# lookups.
 #
 #ldap_timeout = 10
 
index 36485ae50bd8401bef2a03b6d0877845b47f813b..e672fb89522d1b5652fbe4be7abeb99f0c86cdad 100644 (file)
@@ -165,7 +165,11 @@ max_idle = 100s
 max_use = 100
 
 # The mydestination parameter specifies the list of domains that this
-# machine considers itself the final destination for.
+# machine considers itself the final destination for. That includes
+# Sendmail-style virtual domains hosted on this machine.
+#
+# Do not include Postfix-style virtual domains - those domains are
+# specified elsewhere (see sample-virtual.cf, and sample-transport.cf).
 #
 # The default is $myhostname + localhost.$mydomain.  On a mail domain
 # gateway, you should also include $mydomain. Do not specify the
index ec7714d60a79a6de323e3a620e295b270dcca1c7..c0ff345f407dc371f03e972584073ba609a8eb31 100644 (file)
@@ -333,7 +333,7 @@ allow_untrusted_routing = no
 # network address, and reject service if it is listed below any of
 # the following domains.
 #
-#maps_rbl_domains = blackholes.mail-abuse.org dialups.mail-abuse.org
+#maps_rbl_domains = blackholes.mail-abuse.org relays.mail-abuse.org
 maps_rbl_domains = blackholes.mail-abuse.org
 
 # The relay_domains parameter restricts what client hostname domains
index 29435090555d2a0c245236edebe8106fe7de6919..a2b8b627a8f1960d45e2153bc8d2c101a11820dc 100644 (file)
@@ -1261,7 +1261,7 @@ Question:
 
 My Postfix server is too slow. When I telnet to the SMTP port
 (<tt>telnet hostname 25</tt>), the response comes after 40 seconds.
-On the other hand, when I telnet to the the POP port (<tt>telnet
+On the other hand, when I telnet to the POP port (<tt>telnet
 hostname 110</tt>) the response comes with no delay.
 
 </blockquote>
@@ -1366,8 +1366,9 @@ record, and that this one PTR record needs a matching A record.
 Some people read the RFCs such that one IP address can have multiple
 PTR records, but that makes PTR records even less useful than they
 already are. And in any case, having multiple names per IP address
-would only worsen the problem of finding out the "official name"
-of a machine's IP address.
+only worsens the problem of finding out the SMTP client hostname.
+
+<hr>
 
 <a name="open_relay"><h3>Help! Postfix is an open relay</h3>
 
@@ -1614,7 +1615,7 @@ The implementation uses two lookup tables. One table defines what
 users are restricted in where they can send mail, and the other
 table defines what destinations are local. It is left as an exercise
 for the reader to change this into a scheme where only some users
-have permission to send send mail to off-site destinations, and
+have permission to send mail to off-site destinations, and
 where most users are restricted.
 
 <p>
@@ -2180,7 +2181,7 @@ types Postfix supports, use the command <b>postconf -m</b>.
 <p>
 
 <li>Execute the command <b>postmap /etc/postfix/virtual</b> whenever
-you edit the the <b>virtual</b> table.
+you edit the <b>virtual</b> table.
 
 <p>
 
index f366e23252ea9eb99be8427b229b6253cf8bee7a..f6a11024bab14dca6c57bf731925d261521f3a53 100644 (file)
@@ -7,12 +7,10 @@
 /*     #include <mail_conf.h>
 /*
 /*     int     get_mail_conf_bool(name, defval)
-/*     const char *path;
 /*     const char *name;
 /*     int     defval;
 /*
 /*     int     get_mail_conf_bool_fn(name, defval)
-/*     const char *path;
 /*     const char *name;
 /*     int     (*defval)();
 /*
index f74fe87c39c1acb4e1f4b588effeab77628d3659..f725dbca0f667b9eaf065164a9cb63f14bba0634 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Postfix-20010228-pl02"
+#define DEF_MAIL_VERSION       "Postfix-20010228-pl03"
 extern char *var_mail_version;
 
 /* LICENSE
index 49b89f403bd0b8770cdc5ed59e8393c1f30e22af..8a1560c5350e5dffb0f526ca50edfef98f42b9f7 100644 (file)
@@ -420,6 +420,13 @@ static int deliver_message(DELIVER_REQUEST *request, char **unused_argv)
     result = state->status;
     lmtp_chat_reset(state);
 
+    /*
+     * XXX State persists until idle timeout, but these fields will be
+     * dangling pointers. Nuke them.
+     */
+    state->request = 0;
+    state->src = 0;
+
     return (result);
 }
 
index 93c40d543ad683032124f449817cd117f6cd4126..1c970dad728cd3ef95d831c033625c0cf8dc8df4 100644 (file)
   * same code that implements command pipelining, so that we can borrow from
   * the existing code for exception handling and error reporting.
   * 
+  * Client states that are associated with sending mail (up to and including
+  * SMTP_STATE_DOT) must have smaller numerical values than the non-sending
+  * states (SMTP_STATE_ABORT .. SMTP_STATE_LAST).
   */
 #define LMTP_STATE_MAIL                0
 #define LMTP_STATE_RCPT                1
@@ -313,6 +316,9 @@ static int lmtp_loop(LMTP_STATE *state, int send_state, int recv_state)
 #define SENDER_IN_WAIT_STATE \
        (send_state == LMTP_STATE_DOT || send_state == LMTP_STATE_LAST)
 
+#define SENDING_MAIL \
+       (recv_state <= LMTP_STATE_DOT)
+
     /*
      * Pipelining support requires two loops: one loop for sending and one
      * for receiving. Each loop has its own independent state. Most of the
@@ -454,8 +460,8 @@ static int lmtp_loop(LMTP_STATE *state, int send_state, int recv_state)
                smtp_timeout_setup(state->session->stream,
                                   *xfer_timeouts[recv_state]);
                if ((except = vstream_setjmp(state->session->stream)) != 0)
-                   RETURN(lmtp_stream_except(state, except,
-                                             xfer_states[recv_state]));
+                   RETURN(SENDING_MAIL ? lmtp_stream_except(state, except,
+                                            xfer_states[recv_state]) : -1);
                resp = lmtp_chat_resp(state);
 
                /*
index e525247340b527f97a04985108be7296d265a4a2..b762d0849c729583b31370236f6f1d0fda652bd3 100644 (file)
@@ -238,11 +238,19 @@ static void super(char **queues, int action)
            }
 
            /*
-            * Skip temporary files that aren't old enough.
+            * Skip over files with illegal names. The library routines
+            * refuse to operate on them.
             */
            if (mail_queue_id_ok(path) == 0)
                continue;
 
+           /*
+            * Skip temporary files that aren't old enough.
+            */
+           if (qp->perms == MAIL_QUEUE_STAT_READY
+               && (st.st_mode & S_IRWXU) != qp->perms)
+               continue;
+
            /*
             * See if this file sits in the right place in the file system
             * hierarchy. Its place may be wrong after a change to the
index e9311ef4a552d59b2a7af921555738659c97fe8f..a3daf6422a761d0ee2ee677c2484ae00fec2f67d 100644 (file)
 /*     the reason for failure is shown. This mode of operation is implemented
 /*     by connecting to the \fBshowq\fR(8) daemon.
 /* .IP \fBnewaliases\fR
-/*     Initialize the alias database. If no alias database type is
-/*     specified, the program uses the type specified in the
-/*     \fBdatabase_type\fR configuration parameter; if no input file
-/*     is specified, the program processes the file(s) specified with the
-/*     \fBalias_database\fR configuration parameter. This mode of operation
-/*     is implemented by running the \fBpostalias\fR(1) command.
+/*     Initialize the alias database.  If no input file is specified (with
+/*     the \fB-oA\fR option, see below), the program processes the file(s)
+/*     specified with the \fBalias_database\fR configuration parameter.
+/*     If no alias database type is specified, the program uses the type
+/*     specified with the \fBdatabase_type\fR configuration parameter.
+/*     This mode of operation is implemented by running the \fBpostalias\fR(1)
+/*     command.
 /* .sp
 /*     Note: it may take a minute or so before an alias database update
 /*     becomes visible. Use the \fBpostfix reload\fR command to eliminate
@@ -517,12 +518,10 @@ static void show_queue(void)
     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)
+           if (vstream_fwrite(VSTREAM_OUT, buf, n) != n
+               || vstream_fflush(VSTREAM_OUT) != 0)
                msg_fatal("write error: %m");
 
-       if (vstream_fflush(VSTREAM_OUT))
-           msg_fatal("write error: %m");
-
        if (vstream_fclose(showq))
            msg_warn("close: %m");
     }
@@ -949,6 +948,8 @@ int     main(int argc, char **argv)
     case SM_MODE_NEWALIAS:
        if (argv[OPTIND])
            msg_fatal("alias initialization mode requires no recipient");
+       if (*var_alias_db_map == 0)
+           return (0);
        ext_argv = argv_alloc(2);
        argv_add(ext_argv, "postalias", (char *) 0);
        for (n = 0; n < msg_verbose; n++)
index c9b0a54e85844833ff271b1fd36744e5b2c299bb..a7871312379aaefa149b9274b4ae7dd1b56de6e0 100644 (file)
   * By default, the receiver skips the QUIT response. Some SMTP servers
   * disconnect after responding to ".", and some SMTP servers wait before
   * responding to QUIT.
+  * 
+  * Client states that are associated with sending mail (up to and including
+  * SMTP_STATE_DOT) must have smaller numerical values than the non-sending
+  * states (SMTP_STATE_ABORT .. SMTP_STATE_LAST).
   */
 #define SMTP_STATE_MAIL                0
 #define SMTP_STATE_RCPT                1
@@ -294,6 +298,9 @@ int     smtp_xfer(SMTP_STATE *state)
 #define SENDER_IN_WAIT_STATE \
        (send_state == SMTP_STATE_DOT || send_state == SMTP_STATE_LAST)
 
+#define SENDING_MAIL \
+       (recv_state <= SMTP_STATE_DOT)
+
     /*
      * We use SMTP command pipelining if the server said it supported it.
      * Since we use blocking I/O, RFC 2197 says that we should inspect the
@@ -451,8 +458,8 @@ int     smtp_xfer(SMTP_STATE *state)
                smtp_timeout_setup(state->session->stream,
                                   *xfer_timeouts[recv_state]);
                if ((except = vstream_setjmp(state->session->stream)) != 0)
-                   RETURN(smtp_stream_except(state, except,
-                                             xfer_states[recv_state]));
+                   RETURN(SENDING_MAIL ? smtp_stream_except(state, except,
+                                            xfer_states[recv_state]) : -1);
                resp = smtp_chat_resp(state);
 
                /*
index d93043b82fbead1fb4ce8c2a8e5a7b823c2c97ec..48f8c82e871342d909929d0550eb3a8fa0b8e81d 100644 (file)
@@ -834,7 +834,7 @@ static int data_cmd(SMTPD_STATE *state, int argc, SMTPD_TOKEN *unused_argv)
            state->error_mask |= MAIL_ERROR_PROTOCOL;
            smtpd_chat_reply(state, "503 Error: need RCPT command");
        } else {
-           smtpd_chat_reply(state, "550 Error: no valid recipients");
+           smtpd_chat_reply(state, "554 Error: no valid recipients");
        }
        return (-1);
     }
index 656a652ba66721d6521911fe285127f752252036..5f9596d3d585e5c98cf1347e60a2e7f32fc62d15 100644 (file)
@@ -551,6 +551,26 @@ static int smtpd_check_reject(SMTPD_STATE *state, int error_class,
     }
     printable(STR(error_text), ' ');
 
+    /*
+     * XXX The code below also appears in the SMTP server reply output
+     * routine. It is duplicated here in order to avoid discrepancies between
+     * the reply codes that are shown in "reject" logging and the reply codes
+     * that are actually sent to the SMTP client.
+     * 
+     * Implementing the soft_bounce safety net in the SMTP server reply output
+     * routine has the advantage that it covers all 5xx replies, including
+     * SMTP protocol or syntax errors, which makes soft_bounce great for
+     * non-destructive tests (especially by people who are paranoid about
+     * losing mail).
+     * 
+     * We could eliminate the code duplication and implement the soft_bounce
+     * safety net only in the code below. But then the safety net would cover
+     * the UCE restrictions only. This would be at odds with the documentation
+     * which says soft_bounce changes all 5xx replies into 4xx ones.
+     */
+    if (var_soft_bounce && STR(error_text)[0] == '5')
+       STR(error_text)[0] = '4';
+
     /*
      * Log what is happening. When the sysadmin discards policy violation
      * postmaster notices, this may be the only trace left that service was
index 44b121d81271e0e51487e727e133e354a836613e..776a437db560b9e6c03c48a99f2b13f9250227ab 100644 (file)
@@ -584,6 +584,8 @@ static const char *dict_ldap_lookup(DICT *dict, const char *name)
        ldap_msgfree(res);
     if (filter_buf != 0)
        vstring_free(filter_buf);
+    if (escaped_name != 0) 
+       vstring_free(escaped_name);
 
     /*
      * If we had an error, return nothing, Otherwise, return the result, if
index 13c071cc7c1708cdd8594f383210bcf1368baed3..20016e57e67dfd32c717db3836e4169f199ad48d 100644 (file)
@@ -6,7 +6,7 @@
 /* SYNOPSIS
 /*     #include <sane_fsops.h>
 /*
-/*     int     sane_link(old, new)
+/*     int     sane_link(from, to)
 /*     const char *from;
 /*     const char *to;
 /* DESCRIPTION
index 53af93cbb104c6fb26554cb6b32adb2b406b2b8c..52c6d4c7ff392d14fb9241abfa102cb96f08042f 100644 (file)
@@ -10,7 +10,7 @@
 /*     int     fd;
 /* DESCRIPTION
 /*     writable() asks the kernel if the specified file descriptor
-/*     is writable, i.e. a read operation would not block.
+/*     is writable, i.e. a write operation would not block.
 /*
 /*     Arguments:
 /* .IP fd