]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-2.9-20110321
authorWietse Venema <wietse@porcupine.org>
Mon, 21 Mar 2011 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <viktor@dukhovni.org>
Tue, 5 Feb 2013 06:37:17 +0000 (06:37 +0000)
postfix/HISTORY
postfix/RELEASE_NOTES
postfix/html/postconf.5.html
postfix/man/man5/postconf.5
postfix/proto/postconf.proto
postfix/src/global/mail_queue.c
postfix/src/global/mail_queue.h
postfix/src/global/mail_version.h

index ac1b98e6acfaa811fdd3c7e859d7cfa3c2bf3ed8..e628635d894ccf2403a97b5e697a4160b085a83e 100644 (file)
@@ -16685,22 +16685,6 @@ Apologies for any names omitted.
        src/global/dict_ldap.c src/global/cfg_parser.h
        src/global/cfg_parser.c.
 
-20110320
-
-       Feature: specify "enable_long_queue_ids = yes" to enable
-       support for non-repeating queue IDs (also used as queue
-       file names). These queue IDs encode the time and inode
-       number with a safe alphabet of the 52 characters 0-9B-Zb-z.
-       The alphabet excludes vowels (AEIOUaeiou) to avoid creating
-       real words.  The queue ID format is: time in seconds, time
-       in microseconds, 'z', inode number (the inode number is
-       encoded without using the 'z' character of the safe alphabet).
-       Turning on long queue IDs changes the width of the first
-       output column of the mailq (postqueue -p) command, and
-       changes the appearance of Postfix Message-ID headers to
-       queueID@myhostname.  Files: global/file_id.[hc],
-       global/safe_ultostr.[hc], global/mail_queue.[hc],
-       postsuper/postsuper.c, showq/showq.c
 20110311
 
        Feature: Base 32 encoder/decoder per RFC 4648. This code
@@ -16725,3 +16709,32 @@ Apologies for any names omitted.
        expression of the form ``("text1" "text2") + constant'' so
        we don't try to be so clever. Fix by Victor Duchovni.  File:
        global/mail_params.h.
+
+20110320
+
+       Feature: specify "enable_long_queue_ids = yes" to enable
+       support for non-repeating queue IDs (also used as queue
+       file names). These queue IDs encode the time and inode
+       number with a safe alphabet of the 52 characters 0-9B-Zb-z.
+       The alphabet excludes vowels (AEIOUaeiou) to avoid creating
+       real words.  The queue ID format is: time in seconds, time
+       in microseconds, 'z', inode number (the inode number is
+       encoded without using the 'z' character of the safe alphabet).
+       Turning on long queue IDs changes the width of the first
+       output column of the mailq (postqueue -p) command, and
+       changes the appearance of Postfix Message-ID headers to
+       queueID@myhostname.  Files: global/file_id.[hc],
+       global/safe_ultostr.[hc], global/mail_queue.[hc],
+       postsuper/postsuper.c, showq/showq.c
+
+20110321
+
+       Performance: with long queue file names, queue hashing now
+       produces the same result as with short names. Postfix uses
+       the hexadecimal representation of the file creation time
+       in microseconds, instead of the beginning of the file name
+       which changes once every year or so, a problem that was
+       reported by Victor Duchovni. The base 16 encoding gives
+       finer control over the number of directories than possible
+       with base 52 encoding.  Files: global/mail_queue.c.  This
+       change requires "postfix reload".
index b51bc45932c87987727c2233635f10a610cbcc2e..3388e2885742e2682550425fab0f5bbd5e10eaee 100644 (file)
@@ -14,6 +14,13 @@ specifies the release date of a stable release or snapshot release.
 If you upgrade from Postfix 2.7 or earlier, read RELEASE_NOTES-2.8
 before proceeding.
 
+Incompatible changes with snapshot 20110321
+===========================================
+
+You need to "postfix reload" after upgrade from snapshot 20110320.
+The hash_queue_names algorithm was changed for better performance
+with long queue IDs.
+
 Incompatible changes with snapshot 20110320
 ===========================================
 
index e0123aa129bedb7bb0b086b10a8e505b7eeb0414..787d8750769c7afd79292c3f085859fb8f79f849 100644 (file)
@@ -2724,6 +2724,12 @@ is the file inode number encoded in the first 51 characters of the
 <li> <p> The mailq (postqueue -p) output has a wider Queue ID column.
 The number of whitespace-separated fields is not changed. <p>
 
+<li> <p> The <a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a> algorithm uses the first characters
+of the queue file creation time in microseconds, after conversion
+into hexadecimal representation. This produces the same queue hashing
+behavior as if the queue file name was created with "<a href="postconf.5.html#enable_long_queue_ids">enable_long_queue_ids</a>
+= no". </p>
+
 </ul>
 
 <p> Changing the parameter value to "no" has the following effects:
@@ -2747,6 +2753,10 @@ second.
 <li> <p> The mailq (postqueue -p) output has the same format as
 with Postfix &le; 2.8. <p>
 
+<li> <p> The <a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a> algorithm uses the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds.  </p>
+
 </ul>
 
 <p> Before migration to Postfix &le; 2.8, the following commands
@@ -2761,6 +2771,8 @@ are required to convert long queue file names into short names: </p>
 <p> Repeat the postsuper command until it reports no more queue file
 name changes. </p>
 
+<p> This feature is available in Postfix 2.9 and later.  </p>
+
 
 </DD>
 
@@ -3180,8 +3192,18 @@ process instance while mail is being forwarded.  </p>
 
 <p>
 The number of subdirectory levels for queue directories listed with
-the <a href="postconf.5.html#hash_queue_names">hash_queue_names</a> parameter.
-</p>
+the <a href="postconf.5.html#hash_queue_names">hash_queue_names</a> parameter. Queue hashing is implemented by
+creating one or more levels of directories with one-character names.
+Originally, these directory names were equal to the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds. </p>
+
+<p> With long queue file names, queue hashing produces the same
+results as with short names. The file creation time in microseconds
+is converted into hexadecimal form before the result is used for
+queue hashing.  The base 16 encoding gives finer control over the
+number of subdirectories than is possible with the base 52 encoding
+of long queue file names.  </p>
 
 <p>
 After changing the <a href="postconf.5.html#hash_queue_names">hash_queue_names</a> or <a href="postconf.5.html#hash_queue_depth">hash_queue_depth</a> parameter,
index f245f0ab4a532541ae4d7bda802c541bc12b9cc2..06f3839eae41fca0cccee243a3fe52ddbc3f6f70 100644 (file)
@@ -1537,6 +1537,12 @@ New messages have a Message-ID header with
 .IP \(bu
 The mailq (postqueue -p) output has a wider Queue ID column.
 The number of whitespace-separated fields is not changed.
+.IP \(bu
+The hash_queue_depth algorithm uses the first characters
+of the queue file creation time in microseconds, after conversion
+into hexadecimal representation. This produces the same queue hashing
+behavior as if the queue file name was created with "enable_long_queue_ids
+= no".
 .PP
 Changing the parameter value to "no" has the following effects:
 .IP \(bu
@@ -1555,6 +1561,10 @@ second.
 .IP \(bu
 The mailq (postqueue -p) output has the same format as
 with Postfix <= 2.8.
+.IP \(bu
+The hash_queue_depth algorithm uses the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds.
 .PP
 Before migration to Postfix <= 2.8, the following commands
 are required to convert long queue file names into short names:
@@ -1571,6 +1581,8 @@ are required to convert long queue file names into short names:
 .PP
 Repeat the postsuper command until it reports no more queue file
 name changes.
+.PP
+This feature is available in Postfix 2.9 and later.
 .SH enable_original_recipient (default: yes)
 Enable support for the X-Original-To message header. This header
 is needed for multi-recipient mailboxes.
@@ -1796,7 +1808,18 @@ Delivered-To: address, it ties up one queue file and one cleanup
 process instance while mail is being forwarded.
 .SH hash_queue_depth (default: 1)
 The number of subdirectory levels for queue directories listed with
-the hash_queue_names parameter.
+the hash_queue_names parameter. Queue hashing is implemented by
+creating one or more levels of directories with one-character names.
+Originally, these directory names were equal to the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds.
+.PP
+With long queue file names, queue hashing produces the same
+results as with short names. The file creation time in microseconds
+is converted into hexadecimal form before the result is used for
+queue hashing.  The base 16 encoding gives finer control over the
+number of subdirectories than is possible with the base 52 encoding
+of long queue file names.
 .PP
 After changing the hash_queue_names or hash_queue_depth parameter,
 execute the command "\fBpostfix reload\fR".
index fddc672f3a0d4c01467ef6f3f279c7585babf833..09cdae5611c9e2901d4323b4b01c2e815485e7b3 100644 (file)
@@ -1688,8 +1688,18 @@ performance when handling lots of deferred mail.
 
 <p>
 The number of subdirectory levels for queue directories listed with
-the hash_queue_names parameter.
-</p>
+the hash_queue_names parameter. Queue hashing is implemented by
+creating one or more levels of directories with one-character names.
+Originally, these directory names were equal to the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds. </p>
+
+<p> With long queue file names, queue hashing produces the same
+results as with short names. The file creation time in microseconds
+is converted into hexadecimal form before the result is used for
+queue hashing.  The base 16 encoding gives finer control over the
+number of subdirectories than is possible with the base 52 encoding
+of long queue file names.  </p>
 
 <p>
 After changing the hash_queue_names or hash_queue_depth parameter,
@@ -14114,6 +14124,12 @@ is the file inode number encoded in the first 51 characters of the
 <li> <p> The mailq (postqueue -p) output has a wider Queue ID column.
 The number of whitespace-separated fields is not changed. <p>
 
+<li> <p> The hash_queue_depth algorithm uses the first characters
+of the queue file creation time in microseconds, after conversion
+into hexadecimal representation. This produces the same queue hashing
+behavior as if the queue file name was created with "enable_long_queue_ids
+= no". </p>
+
 </ul>
 
 <p> Changing the parameter value to "no" has the following effects:
@@ -14137,6 +14153,10 @@ second.
 <li> <p> The mailq (postqueue -p) output has the same format as
 with Postfix &le; 2.8. <p>
 
+<li> <p> The hash_queue_depth algorithm uses the first characters
+of the queue file name, with the hexadecimal representation of the
+file creation time in microseconds.  </p>
+
 </ul>
 
 <p> Before migration to Postfix &le; 2.8, the following commands
@@ -14150,3 +14170,5 @@ are required to convert long queue file names into short names: </p>
 
 <p> Repeat the postsuper command until it reports no more queue file
 name changes. </p>
+
+<p> This feature is available in Postfix 2.9 and later.  </p>
index 820b682a915bed6bcc4cffefac1edc356cdc0451..95f80490b51658a19ca6e90e806307d4c8b35b00 100644 (file)
@@ -149,6 +149,8 @@ const char *mail_queue_dir(VSTRING *buf, const char *queue_name,
     static VSTRING *private_buf = 0;
     static VSTRING *hash_buf = 0;
     static ARGV *hash_queue_names = 0;
+    static VSTRING *usec_buf = 0;
+    const char *delim;
     char  **cpp;
 
     /*
@@ -183,8 +185,14 @@ const char *mail_queue_dir(VSTRING *buf, const char *queue_name,
      */
     for (cpp = hash_queue_names->argv; *cpp; cpp++) {
        if (strcasecmp(*cpp, queue_name) == 0) {
+           if (MQID_FIND_LG_INUM_SEPARATOR(delim, queue_id)) {
+               if (usec_buf == 0)
+                   usec_buf = vstring_alloc(20);
+               MQID_LG_GET_HEX_USEC(usec_buf, delim);
+               queue_id = STR(usec_buf);
+           }
            vstring_strcat(buf,
-                     dir_forest(hash_buf, queue_id, var_hash_queue_depth));
+                      dir_forest(hash_buf, queue_id, var_hash_queue_depth));
            break;
        }
     }
index a1a0e8b9edde5fbb57d59a55c20fe585a31364ca..a8c7c64baedefe498ac34b76f39f8dbb7b72904d 100644 (file)
@@ -122,6 +122,9 @@ extern int mail_queue_id_ok(const char *);
 #define MQID_LG_ENCODE_INUM(buf, val) \
        MQID_LG_ENCODE((buf), (val), MQID_LG_INUM_BASE, MQID_LG_INUM_PAD)
 
+#define MQID_LG_DECODE_USEC(str, ulval, error) \
+       MQID_LG_DECODE((str), (ulval), MQID_LG_USEC_BASE, (error))
+
 #define MQID_LG_DECODE_INUM(str, ulval, error) \
        MQID_LG_DECODE((str), (ulval), MQID_LG_INUM_BASE, (error))
 
@@ -135,6 +138,14 @@ extern int mail_queue_id_ok(const char *);
        (error) = (*_end != 0 || ((ulval) == ULONG_MAX && errno == ERANGE)); \
     } while (0)
 
+#define MQID_LG_GET_HEX_USEC(bp, zp) do { \
+       int _error; \
+       unsigned long _us_val; \
+       vstring_strncpy((bp), (zp) - MQID_LG_USEC_PAD, MQID_LG_USEC_PAD); \
+       MQID_LG_DECODE_USEC(STR(bp), _us_val, _error); \
+       (void) MQID_SH_ENCODE_USEC((bp), _us_val); \
+    } while (0)
+
  /*
   * The short repeating queue ID is encoded in upper-case hexadecimal, and is
   * the concatenation of:
index 692f46cca5332dce2eaa046efeed9e18208d6af8..c463c626a2f6e03691e18fd37b68afa69f526b02 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20110320"
+#define MAIL_RELEASE_DATE      "20110321"
 #define MAIL_VERSION_NUMBER    "2.9"
 
 #ifdef SNAPSHOT