From: Wietse Venema Date: Fri, 25 May 2001 05:00:00 +0000 (-0500) Subject: snapshot-20010525 X-Git-Tag: v1.1.0~58 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=268d990779babf11881969e3c7b713c4533023ef;p=thirdparty%2Fpostfix.git snapshot-20010525 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index a7f7bb214..c8d8cbc3e 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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. diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index 3a7c71adb..ccb56cf5f 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -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 ==================================== diff --git a/postfix/html/faq.html b/postfix/html/faq.html index 011e7528e..96bc1229b 100644 --- a/postfix/html/faq.html +++ b/postfix/html/faq.html @@ -3063,52 +3063,84 @@ that the file name will collide with another queue file.

-

-

+

Procedure 2: Your Postfix queue is not empty, or you are +running a Postfix release prior to 20010525

- -

Undefined symbols: ___dn_expand, ___res_init etc.

diff --git a/postfix/html/postsuper.1.html b/postfix/html/postsuper.1.html index 724c28214..c6dddbb7c 100644 --- a/postfix/html/postsuper.1.html +++ b/postfix/html/postsuper.1.html @@ -24,7 +24,7 @@ POSTSUPER(1) POSTSUPER(1) Options: - -d queue_id + -d queue_id (Postfix versions >= 20010525) Delete one message with the named queue ID from the named mail queue(s) (default: incoming, active and deferred). If a queue_id of - is specified, the @@ -74,7 +74,7 @@ POSTSUPER(1) POSTSUPER(1) -p Purge old temporary files that are left over after system or software crashes. - -r queue_id + -r queue_id (Postfix versions >= 20010525) Requeue the message with the named queue ID from the named mail queue(s) (default: incoming, active and deferred). To requeue multiple messages, spec- @@ -103,28 +103,28 @@ POSTSUPER(1) POSTSUPER(1) recommended to perform this operation once before Postfix startup. - o 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. + o (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. o 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 hash_queue_names and/or hash_queue_depth configuration parameters. -v Enable verbose logging for debugging purposes. Mul- - tiple -v options make the software increasingly + tiple -v options make the software increasingly verbose. DIAGNOSTICS - Problems are reported to the standard error stream and to + Problems are reported to the standard error stream and to syslogd. - postsuper reports the number of messages deleted with -d, - the number of messages requeued with -r, and the number of + postsuper reports the number of messages deleted with -d, @@ -137,23 +137,24 @@ POSTSUPER(1) POSTSUPER(1) POSTSUPER(1) POSTSUPER(1) - messages whose queue file name was fixed with -s. The + the number of messages requeued with -r, and the number of + messages whose queue file name was fixed with -s. The report is written to the standard error stream and to sys- logd. CONFIGURATION PARAMETERS - See the Postfix main.cf file for syntax details and for + See the Postfix main.cf file for syntax details and for default values. hash_queue_depth Number of subdirectory levels for hashed queues. hash_queue_names - The names of queues that are organized into multi- + The names of queues that are organized into multi- ple levels of subdirectories. LICENSE - The Secure Mailer license must be distributed with this + The Secure Mailer license must be distributed with this software. AUTHOR(S) @@ -191,7 +192,6 @@ POSTSUPER(1) POSTSUPER(1) - 3 diff --git a/postfix/man/man1/postsuper.1 b/postfix/man/man1/postsuper.1 index 80fc63864..599293151 100644 --- a/postfix/man/man1/postsuper.1 +++ b/postfix/man/man1/postsuper.1 @@ -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. diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index a667503e8..1a1faa1bb 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -15,7 +15,7 @@ * Version of this program. */ #define VAR_MAIL_VERSION "mail_version" -#define DEF_MAIL_VERSION "Snapshot-20010524" +#define DEF_MAIL_VERSION "Snapshot-20010525" extern char *var_mail_version; /* LICENSE diff --git a/postfix/src/lmtp/lmtp.c b/postfix/src/lmtp/lmtp.c index 62bf023a1..0b538f8fb 100644 --- a/postfix/src/lmtp/lmtp.c +++ b/postfix/src/lmtp/lmtp.c @@ -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); } diff --git a/postfix/src/lmtp/lmtp_proto.c b/postfix/src/lmtp/lmtp_proto.c index b2a01e59f..7c6db9a8b 100644 --- a/postfix/src/lmtp/lmtp_proto.c +++ b/postfix/src/lmtp/lmtp_proto.c @@ -139,6 +139,9 @@ * 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); /* diff --git a/postfix/src/postsuper/postsuper.c b/postfix/src/postsuper/postsuper.c index 80ee5c30c..af4336691 100644 --- a/postfix/src/postsuper/postsuper.c +++ b/postfix/src/postsuper/postsuper.c @@ -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) { diff --git a/postfix/src/smtp/smtp_proto.c b/postfix/src/smtp/smtp_proto.c index b40f0dea6..fd258edc5 100644 --- a/postfix/src/smtp/smtp_proto.c +++ b/postfix/src/smtp/smtp_proto.c @@ -114,6 +114,10 @@ * 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); /* diff --git a/postfix/src/util/sys_defs.h b/postfix/src/util/sys_defs.h index 664b32938..da8388d31 100644 --- a/postfix/src/util/sys_defs.h +++ b/postfix/src/util/sys_defs.h @@ -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