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.
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.
-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
====================================
<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,
<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
</ul>
-</ul>
-
<hr>
<a name="bind"><h3>Undefined symbols: ___dn_expand, ___res_init etc.</h3></a>
Options:
- <b>-d</b> <i>queue_id</i>
+ <b>-d</b> <i>queue_id</i> (Postfix versions >= 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
<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 >= 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-
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 >= 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>,
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>
-
3
\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).
.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).
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.
* 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
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);
}
* 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
#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
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);
/*
/* \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).
/* .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).
/* 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.
/*
* 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) {
}
/*
- * 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) {
* 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
#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
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);
/*
* 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