From: Wietse Venema Date: Mon, 21 Mar 2011 05:00:00 +0000 (-0500) Subject: postfix-2.9-20110321 X-Git-Tag: v2.9.0-RC1~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1aa0644cc3580efe500106c3ce2c5d06b2e24ed;p=thirdparty%2Fpostfix.git postfix-2.9-20110321 --- diff --git a/postfix/HISTORY b/postfix/HISTORY index ac1b98e6a..e628635d8 100644 --- a/postfix/HISTORY +++ b/postfix/HISTORY @@ -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". diff --git a/postfix/RELEASE_NOTES b/postfix/RELEASE_NOTES index b51bc4593..3388e2885 100644 --- a/postfix/RELEASE_NOTES +++ b/postfix/RELEASE_NOTES @@ -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 =========================================== diff --git a/postfix/html/postconf.5.html b/postfix/html/postconf.5.html index e0123aa12..787d87507 100644 --- a/postfix/html/postconf.5.html +++ b/postfix/html/postconf.5.html @@ -2724,6 +2724,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: @@ -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.

    + @@ -3180,8 +3192,18 @@ process instance while mail is being forwarded.

    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