From: Wietse Venema The mailq (postqueue -p) output has a wider Queue ID column.
The number of whitespace-separated fields is not changed.
+ 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". Changing the parameter value to "no" has the following effects:
@@ -2747,6 +2753,10 @@ second.
The mailq (postqueue -p) output has the same format as
with Postfix ≤ 2.8.
+ 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. Before migration to Postfix ≤ 2.8, the following commands
@@ -2761,6 +2771,8 @@ are required to convert long queue file names into short names: Repeat the postsuper command until it reports no more queue file
name changes. This feature is available in Postfix 2.9 and later.
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. + +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.
After changing the hash_queue_names or hash_queue_depth parameter, diff --git a/postfix/man/man5/postconf.5 b/postfix/man/man5/postconf.5 index f245f0ab4..06f3839ea 100644 --- a/postfix/man/man5/postconf.5 +++ b/postfix/man/man5/postconf.5 @@ -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". diff --git a/postfix/proto/postconf.proto b/postfix/proto/postconf.proto index fddc672f3..09cdae561 100644 --- a/postfix/proto/postconf.proto +++ b/postfix/proto/postconf.proto @@ -1688,8 +1688,18 @@ performance when handling lots of deferred mail.
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. + +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.
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
The mailq (postqueue -p) output has a wider Queue ID column. The number of whitespace-separated fields is not changed.
+
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".
+Changing the parameter value to "no" has the following effects: @@ -14137,6 +14153,10 @@ second.
The mailq (postqueue -p) output has the same format as with Postfix ≤ 2.8.
+
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.
+Before migration to Postfix ≤ 2.8, the following commands @@ -14150,3 +14170,5 @@ are required to convert long queue file names into short names:
Repeat the postsuper command until it reports no more queue file name changes.
+ +This feature is available in Postfix 2.9 and later.
diff --git a/postfix/src/global/mail_queue.c b/postfix/src/global/mail_queue.c index 820b682a9..95f80490b 100644 --- a/postfix/src/global/mail_queue.c +++ b/postfix/src/global/mail_queue.c @@ -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; } } diff --git a/postfix/src/global/mail_queue.h b/postfix/src/global/mail_queue.h index a1a0e8b9e..a8c7c64ba 100644 --- a/postfix/src/global/mail_queue.h +++ b/postfix/src/global/mail_queue.h @@ -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: diff --git a/postfix/src/global/mail_version.h b/postfix/src/global/mail_version.h index 692f46cca..c463c626a 100644 --- a/postfix/src/global/mail_version.h +++ b/postfix/src/global/mail_version.h @@ -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