]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
snapshot-20010525
authorWietse Venema <wietse@porcupine.org>
Fri, 25 May 2001 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:27:18 +0000 (06:27 +0000)
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/faq.html
postfix/html/postsuper.1.html
postfix/man/man1/postsuper.1
postfix/src/global/mail_version.h
postfix/src/lmtp/lmtp.c
postfix/src/lmtp/lmtp_proto.c
postfix/src/postsuper/postsuper.c
postfix/src/smtp/smtp_proto.c
postfix/src/util/sys_defs.h

index a7f7bb21499d841ec535ac82f96c01875b5891b2..c8d8cbc3e1d3a9b2aaba83df15e7b7accb6a70a5 100644 (file)
@@ -5174,7 +5174,7 @@ Apologies for any names omitted.
        822 address parser. File: global/tok822_parse.c.
 
        Standard: annotated the source code with comments based on
-       RFC 2821 and 2822. Not all the changes make sense.
+       RFC 2821 and 2822. Not all the RFC changes make sense.
 
        RFC 2821 recommendation: treat a RCPT 552 reply as if the
        server sent 452. Files: smtp/smtp_proto.c, lmtp/lmtp_proto.c.
@@ -5188,17 +5188,36 @@ Apologies for any names omitted.
 20010522
 
        Feature: "postsuper -r queueID" re-queues a message, and
-       "postsuper -R" re-queues all mail. The message is moved to
-       the maildrop queue so that the pickup daemon will copy it
-       to a new queue file, and so that address rewriting will be
-       done again. This is useful after changes of address rewriting
-       or virtual mappings.
+       "postsuper -r ALL" re-queues all mail. The message is moved
+       to the maildrop queue so that the pickup daemon will copy
+       it to a new queue file, and so that address rewriting will
+       be done again. This is useful after changes of address
+       rewriting or virtual mappings.
+
+       Feature: "postsuper -d ALL [queue-name]" deletes a bunch
+       of mail.
 
 20010523
 
        Feature: "postsuper -s" (which is done by default) renames
-       queue files whose queue ID does not match the message file
-       inode number.
+       queue files whose name (queue ID) does not match the message
+       file inode number.
 
        Bugfix: memory leak in the LDAP client module. Alain
-       Thivillon,France Teaser - Groupe Firstream.
+       Thivillon, France Teaser - Groupe Firstream.
+
+20010525
+
+       Portability: gcc 2.6.3 does not have __attribute__ (Clive
+       Jones, dgw.co.uk). File: util/sys_defs.h.
+
+       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 3a7c71adb81b663f3b91e1baad2a5d98a72ee5b7..ccb56cf5f0c4a2594e418cf1d71943df01d3cb3d 100644 (file)
@@ -1,33 +1,44 @@
-Incompatible changes with snapshot-20010522
+Incompatible changes with snapshot-20010525
 ===========================================
 
-The Postfix SMTP server always sends EHLO at the beginning of an
-SMTP session. Specify "smtp_always_send_ehlo = no" for the old
-behavior, which is to send EHLO only when the server greeting banner
-contains the word ESMTP.
+As per RFC 2821, the Postfix SMTP client now always sends EHLO at
+the beginning of an SMTP session. Specify "smtp_always_send_ehlo
+= no" for the old behavior, which is to send EHLO only when the
+server greeting banner contains the word ESMTP.
 
-Specifying EHLO in the middle of an SMTP session resets the SMTP
-server state just like RSET. This behavior cannot be disabled.
+As per RFC 2821, an EHLO command in the middle of an SMTP session
+resets the Postfix SMTP server state just like RSET. This behavior
+cannot be disabled.
 
-Major changes with snapshot-20010522
+The postfix-script file has changed: "postfix start" no longer does
+a "find" on all Postfix directories for core files; instead, the
+postsuper command now finds and renames all queue files whose names
+do not match their message file inode number.
+
+Major changes with snapshot-20010525
 ====================================
 
-This release contains revisions of some fine details in the light
-of the new RFC 2821 and RFC 2822 standards. Changes that may affect
-interoperability are listed above under "incompatible changes".
+This release contains many little revisions of little details in
+the light of the new RFC 2821 and RFC 2822 standards. Changes that
+may affect interoperability are listed above under "incompatible
+changes".  Other little details are discussed in comments in the
+source code.
+
+The postsuper queue maintenance tool now renames files whose name
+(queue ID) does not match the message file inode number. This is
+necessary after a Postfix mail queue is restored from another
+machine or from backups.  The feature is selected with the -s
+option, which is the default.
 
-The postsuper tool can rename files whose queue ID does not match
-the queue file inode number. This is necessary when a Postfix mail
-queue is restored from another machine or from backups. The feature
-is selected with the -s option, which is the default.
+The postsuper queue maintenance tool has a new -r (requeue) option
+for subjecting some or all queue files to another iteration of
+address rewriting. This is useful after the virtual or canonical
+maps have changed.
 
 The postsuper queue maintenance tool was extended with options to
 read queue IDs from standard input. This makes the tool easier to
 drive from scripts.
 
-The postsuper queue maintenance tool has a new -r (requeue) option
-for subjecting queue files to another iteration of address rewriting.
-
 Major changes with snapshot-20010502
 ====================================
 
index 011e7528ec8dd411f90c15a805590ac577bbece2..96bc1229b4ac88155ac7bf2fc0d3c093e363ef6b 100644 (file)
@@ -3063,52 +3063,84 @@ that the file name will collide with another queue file.
 
 <p>
 
-<ul>
-
-<li>If your Postfix queue is empty, and if you run a Postfix release
-after 20010524, you can use this procedure to copy a Postfix
-queue from another machine or to restore it from backup.
+The text below describes two different procedures to restore
+queue files from another machine or from backup.
 
-<p>
+<h4> Procedure 1: Your Postfix queue is empty, and you run Postfix
+release 20010525 or later</h4>
 
 <ul>
 
 <li> Stop Postfix, if it was running.
 
+<blockquote>
+<pre>
+# postfix stop
+</pre>
+</blockquote>
+
 <p>
 
 <li> Execute the <b>mailq</b> command. If there is any output, do
-not complete this procedure, but use the second procedure instead.
+not complete this procedure, but use <b>procedure 2</b> instead.
+
+<blockquote>
+<pre>
+# mailq
+</pre>
+</blockquote>
 
 <p>
 
 <li> Copy or restore the queue to the usual place.
 
+<blockquote>
+<pre>
+# cd /var/spool/postfix
+<i>...restore maildrop, incoming, active, deferred, defer, bounce here...</i>
+</pre>
+</blockquote>
+
 <p>
 
 <li> Run the <b>postsuper</b> command. This command will rename
-queue files so that the name matches the message file inode number.
-
-</ul>
+queue files so that the file names match their message file inode
+numbers.
 
-<p>
+<blockquote>
+<pre>
+# postsuper
+</pre>
+</blockquote>
 
-<li> If your Postfix queue is not empty, or if you are running a
-Postfix release prior to 20010524, use the following procedure
-instead.
+</ul>
 
-<p>
+<h4> Procedure 2: Your Postfix queue is not empty, or you are
+running a Postfix release prior to 20010525</h4>
 
 <ul>
 
 <li>Stop Postfix, if it was running.
 
+<blockquote>
+<pre>
+# postfix stop
+</pre>
+</blockquote>
+
 <p>
 
 <li> To avoid queue file name collisions when restoring queue files,
 copy or restore the incoming, active and deferred queue files under
 the maildrop directory instead.
 
+<blockquote>
+<pre>
+# cd /var/spool/postfix/maildrop
+<i>...restore incoming, active, deferred here...</i>
+</pre>
+</blockquote>
+
 <p>
 
 <li>While the next step is going on, don't submit new mail locally,
@@ -3123,9 +3155,6 @@ move files down from their subdirectories.
 
 <p>
 <pre>
-    # postfix stop
-    # cd /var/spool/postfix/maildrop
-    ... restore incoming/active/deferred queue files under the maildrop directory...
     # find incoming active deferred -type f -exec mv '{}' . ';'
     # rm -rf incoming active deferred
     # postfix start
@@ -3138,8 +3167,6 @@ maildrop directory and will give them proper queue file names.
 
 </ul>
 
-</ul>
-
 <hr>
 
 <a name="bind"><h3>Undefined symbols: ___dn_expand, ___res_init etc.</h3></a>
index 724c28214e2c17243b6e359f1a0c330b6d0848b6..c6dddbb7c3c408126c7804f7f2a11c74f8fb5bd6 100644 (file)
@@ -24,7 +24,7 @@ POSTSUPER(1)                                         POSTSUPER(1)
 
        Options:
 
-       <b>-d</b> <i>queue_id</i>
+       <b>-d</b> <i>queue_id</i> (Postfix versions &gt;= 20010525)
               Delete one message with the named queue ID from the
               named  mail queue(s) (default: <b>incoming</b>, <b>active</b> and
               <b>deferred</b>).  If a <i>queue_id</i> of <b>-</b>  is  specified,  the
@@ -74,7 +74,7 @@ POSTSUPER(1)                                         POSTSUPER(1)
        <b>-p</b>     Purge old temporary files that are left over  after
               system or software crashes.
 
-       <b>-r</b> <i>queue_id</i>
+       <b>-r</b> <i>queue_id</i> (Postfix versions &gt;= 20010525)
               Requeue  the  message  with the named queue ID from
               the named mail queue(s) (default: <b>incoming</b>,  <b>active</b>
               and <b>deferred</b>).  To requeue multiple messages, spec-
@@ -103,28 +103,28 @@ POSTSUPER(1)                                         POSTSUPER(1)
               recommended  to  perform this operation once before
               Postfix startup.
 
-              <b>o</b>      Rename files whose name does not  match  the
-                     message file inode number. This operation is
-                     necessary after restoring a mail queue  from
-                     a different machine, or from backup media.
+              <b>o</b>      (Postfix versions &gt;= 20010525) Rename  files
+                     whose  name  does not match the message file
+                     inode number. This  operation  is  necessary
+                     after  restoring a mail queue from a differ-
+                     ent machine, or from backup media.
 
               <b>o</b>      Move queue files that are in the wrong place
                      in the file system hierarchy and remove sub-
                      directories that are no longer needed.  File
-                     position rearrangements are necessary  after
+                     position  rearrangements are necessary after
                      a  change  in  the  <b>hash</b><i>_</i><b>queue</b><i>_</i><b>names</b>  and/or
                      <b>hash</b><i>_</i><b>queue</b><i>_</i><b>depth</b> configuration parameters.
 
        <b>-v</b>     Enable verbose logging for debugging purposes. Mul-
-              tiple  <b>-v</b>  options  make  the software increasingly
+              tiple <b>-v</b> options  make  the  software  increasingly
               verbose.
 
 <b>DIAGNOSTICS</b>
-       Problems are reported to the standard error stream and  to
+       Problems  are reported to the standard error stream and to
        <b>syslogd</b>.
 
-       <b>postsuper</b>  reports the number of messages deleted with <b>-d</b>,
-       the number of messages requeued with <b>-r</b>, and the number of
+       <b>postsuper</b> reports the number of messages deleted with  <b>-d</b>,
 
 
 
@@ -137,23 +137,24 @@ POSTSUPER(1)                                         POSTSUPER(1)
 POSTSUPER(1)                                         POSTSUPER(1)
 
 
-       messages  whose  queue  file  name  was fixed with <b>-s</b>. The
+       the number of messages requeued with <b>-r</b>, and the number of
+       messages whose queue file name  was  fixed  with  <b>-s</b>.  The
        report is written to the standard error stream and to <b>sys-</b>
        <b>logd</b>.
 
 <b>CONFIGURATION</b> <b>PARAMETERS</b>
-       See  the  Postfix  <b>main.cf</b> file for syntax details and for
+       See the Postfix <b>main.cf</b> file for syntax  details  and  for
        default values.
 
        <b>hash</b><i>_</i><b>queue</b><i>_</i><b>depth</b>
               Number of subdirectory levels for hashed queues.
 
        <b>hash</b><i>_</i><b>queue</b><i>_</i><b>names</b>
-              The names of queues that are organized into  multi-
+              The  names of queues that are organized into multi-
               ple levels of subdirectories.
 
 <b>LICENSE</b>
-       The  Secure  Mailer  license must be distributed with this
+       The Secure Mailer license must be  distributed  with  this
        software.
 
 <b>AUTHOR(S)</b>
@@ -191,7 +192,6 @@ POSTSUPER(1)                                         POSTSUPER(1)
 
 
 
-
 
 
                                                                 3
index 80fc638644ad3c0a25e7db7645fcd03316597f35..5992931512a92b3f656bbc3c5251d44aaf3b61c0 100644 (file)
@@ -24,7 +24,7 @@ directories - this includes the \fBincoming\fR, \fBactive\fR and
 \fBdefer\fR and \fBflush\fR directories with log files.
 
 Options:
-.IP "\fB-d \fIqueue_id\fR"
+.IP "\fB-d \fIqueue_id\fR (Postfix versions >= 20010525)"
 Delete one message with the named queue ID from the named
 mail queue(s) (default: \fBincoming\fR, \fBactive\fR and
 \fBdeferred\fR).
@@ -62,7 +62,7 @@ message that it should have deleted.
 .IP \fB-p\fR
 Purge old temporary files that are left over after system or
 software crashes.
-.IP "\fB-r \fIqueue_id\fR"
+.IP "\fB-r \fIqueue_id\fR (Postfix versions >= 20010525)"
 Requeue the message with the named queue ID from the named
 mail queue(s) (default: \fBincoming\fR, \fBactive\fR and
 \fBdeferred\fR).
@@ -90,6 +90,7 @@ Structure check and structure repair.  It is highly recommended
 to perform this operation once before Postfix startup.
 .RS
 .IP \(bu
+(Postfix versions >= 20010525)
 Rename files whose name does not match the message file inode
 number. This operation is necessary after restoring a mail queue
 from a different machine, or from backup media.
index a667503e82bd86d576406a186999ec0648403d7f..1a1faa1bbd762bb6a2ef5960169fee379d1c19d4 100644 (file)
@@ -15,7 +15,7 @@
   * Version of this program.
   */
 #define VAR_MAIL_VERSION       "mail_version"
-#define DEF_MAIL_VERSION       "Snapshot-20010524"
+#define DEF_MAIL_VERSION       "Snapshot-20010525"
 extern char *var_mail_version;
 
 /* LICENSE
index 62bf023a1e9ceb2a9374b3c0640050f5fbbf1440..0b538f8fbd0fcaa99360a1c053e7b9d3a113e60d 100644 (file)
@@ -419,6 +419,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 b2a01e59f9a3550c22dae9c26416e7650cc8c97f..7c6db9a8b98b9b6a18dc462b7e300d655ec43d24 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 80ee5c30c2100efe4492d933ddf6e71a1031e9d5..af43366915285a5983cbff9c220e40d4f8ed497e 100644 (file)
@@ -18,7 +18,7 @@
 /*     \fBdefer\fR and \fBflush\fR directories with log files.
 /*
 /*     Options:
-/* .IP "\fB-d \fIqueue_id\fR"
+/* .IP "\fB-d \fIqueue_id\fR (Postfix versions >= 20010525)"
 /*      Delete one message with the named queue ID from the named
 /*     mail queue(s) (default: \fBincoming\fR, \fBactive\fR and
 /*      \fBdeferred\fR).
@@ -56,7 +56,7 @@
 /* .IP \fB-p\fR
 /*     Purge old temporary files that are left over after system or
 /*     software crashes.
-/* .IP "\fB-r \fIqueue_id\fR"
+/* .IP "\fB-r \fIqueue_id\fR (Postfix versions >= 20010525)"
 /*      Requeue the message with the named queue ID from the named
 /*     mail queue(s) (default: \fBincoming\fR, \fBactive\fR and
 /*      \fBdeferred\fR).
@@ -84,6 +84,7 @@
 /*     to perform this operation once before Postfix startup.
 /* .RS
 /* .IP \(bu
+/*     (Postfix versions >= 20010525)
 /*     Rename files whose name does not match the message file inode
 /*     number. This operation is necessary after restoring a mail queue
 /*     from a different machine, or from backup media.
@@ -874,17 +875,23 @@ int     main(int argc, char **argv)
     /*
      * Basic queue maintenance, as well as mass deletion, mass requeuing, and
      * mass name-to-inode fixing. This ensures that queue files are in the
-     * right place before the queue file by name operations are done.
+     * right place before the file-by-name operations are done.
      */
     if (action & ~ACTIONS_BY_QUEUE_ID)
        super(queues, action & ~ACTIONS_BY_QUEUE_ID);
+
+    /*
+     * If any file names needed changing to match the message file inode
+     * number, those files were named newqeueid#FIX. We need a second pass to
+     * strip the suffix from the new queue ID.
+     */
     if (inode_mismatch > 0)
        super(queues, 0);
 
     /*
-     * Delete queue files by name. This must not be done when queue files
-     * have changed names as a result of the structure check, because we
-     * could be deleiting the wrong message.
+     * Delete queue files by name. This must not be done when queue file
+     * names have changed names as a result of inode number mismatches,
+     * because we could be deleting the wrong message.
      */
     if (action & ACTION_DELETE_ONE) {
        if (inode_mismatch > 0 || inode_fixed > 0) {
@@ -904,9 +911,9 @@ int     main(int argc, char **argv)
     }
 
     /*
-     * Requeue queue files by name. This must not be done when queue files
-     * have changed names as a result of the structure check, because we
-     * could be requeuing the wrong message.
+     * Requeue queue files by name. This must not be done when queue file
+     * names have changed names as a result of inode number mismatches,
+     * because we could be requeuing the wrong message.
      */
     if (action & ACTION_REQUEUE_ONE) {
        if (inode_mismatch > 0 || inode_fixed > 0) {
index b40f0dea6b9b66b0782d813929a86bfa55ac0b70..fd258edc555cbf01937b752578cbda3a4ab5553c 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
@@ -295,6 +299,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
@@ -452,8 +459,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 664b32938d74b1602827fccb7c4fe74341b1f5a9..da8388d3138d051aa730dbb76670a8ee4b7bfb2f 100644 (file)
@@ -880,9 +880,12 @@ typedef int pid_t;
   * warn for missing initializations and other trouble. However, OPENSTEP4
   * gcc 2.7.x cannot handle this so we define this only if NORETURN isn't
   * already defined above.
+  * 
+  * Data point: gcc 2.7.2 has __attribute__ (Wietse Venema) but gcc 2.6.3 does
+  * not (Clive Jones). So we'll set the threshold at 2.7.
   */
 #ifndef NORETURN
-#if __GNUC__ == 2 && __GNUC_MINOR__ >= 5 || __GNUC__ >= 3
+#if __GNUC__ == 2 && __GNUC_MINOR__ >= 7 || __GNUC__ >= 3
 #define NORETURN       void __attribute__((__noreturn__))
 #endif
 #endif