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
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".
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
===========================================
<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:
<li> <p> The mailq (postqueue -p) output has the same format as
with Postfix ≤ 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 ≤ 2.8, the following commands
<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>
<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,
.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
.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:
.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.
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".
<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,
<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:
<li> <p> The mailq (postqueue -p) output has the same format as
with Postfix ≤ 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 ≤ 2.8, the following commands
<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>
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;
/*
*/
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;
}
}
#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))
(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:
* 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