Sendmail: Theory and Practice, Second Edition

When Sendmail places mail in the mail queue it stores different pieces of information for each mail message in different files. The names of these files include a prefix followed by a queue identifier. All files related to the same message have similar names with different prefixes. The body of a file name whose prefix is qf is a queue control file for a message having a particular queue identifier, and the names of the other files relating to that message have similar filename suffixes.
As of Sendmail R8, the queue identifier is based on an encoding of the date and time, and the process identifier. The format is
YMDhmsNPPPPP
Where YMDhms is the encoded version of the year, month, day of the week, hour, and second. The rest of the name is the envelope number followed by the process identifier (5 digits).
The "encoding" used assumes, quoting from a comment in the source code, "that nothing will remain in the queue for longer than 60 years." It uses the static character string, QueueIdChars, which is
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx
For example, Sendmail could create and use a queue identifier of
f7DHV1l01943
on August 13, 2001 at 18:31:01 UT.
| f | QueueIdChars[mod((2001-1900), 60)] |
| 7 | August is the 8th month, so 0 with January having position 0 |
| D | QueueIdChars[Day of the month] |
| H | QueueIdChars[Hour of the day] |
| V | QueueIdChars[Minutes of the hour] |
| 1 | QueueIdChars[Seconds] |
| l | QueueIdChars[Envelope number] |
| 01943 | Process identifier (right-most 5 digits) |
df YMDhmsNPPPPP
The data file,...