Managing the Mail Queue Files and Directories
Posted by jpluimers on 2025/09/15
I wish I had found this overview eons ago: [Wayback/Archive] Managing the Mail Queue Files and Directories.
The most important bits on the various kinds of files that appear in your message queue:
Mail Queue Files
Each message in the queue has a number of files associated with it. The files are named according to the following conventions:TypefIDwhere ID is a unique message queue ID, and Type is one of the following letters indicating the type of file:For example, if a message has a queue ID of AA00269, the following files are created and deleted in the mail queue directory while the sendmail command tries to deliver the message:
dfAA00269 Data file qfAA00269 Control file tfAA00269 Temporary file xfAA00269 Transcript file q Control File
P217031 T566755281 MDeferred: Connection timed out during user open with zeus Sgeo Ramy@zeus H?P?return-path: <geo> Hreceived: by george (0.13 (NL support)/0.01) id AA00269; Thu, 17 Dec 87 10:01:21 CST H?D?date: Thu, 17 Dec 87 10:01:21 CST H?F?From: geo Hmessage-id: <8712171601.AA00269@george> HTo: amy@zeus Hsubject: test
This is a much more elaborate but harder to read part of the Sendmail Book (other copies did not turn op in the searches):
[Wayback/Archive] [Chapter 23] 23.9 The qf File Internals
23.9 The qf File Internals
The
qffile holds all the information that is needed to perform delivery of a queued mail message. The information contained in that file, and its appearance, changes from release to release of sendmail. Here, we document theqffile that is used with V8.8 sendmail. Note that as of V8.7 aVversion line has been introduced to enable future versions to correctly process older version’s queue files.This section must be taken with a proverbial grain of salt. The internals of the
qffile are essentially an internal interface to sendmail and, as such, are subject to change without notice. The information offered here is intended only to help debug sendmail problems. It is not intended (and we strongly discourage its use) as a guide for writing files directly to the queue.The
qffile is line-oriented, containing one item of information per line. Each line begins with a single uppercase character (the code letter), which specifies the contents of the line. Each code letter is followed, with no intervening space, by the information appropriate to the letter. The complete list of code letters is shown in Table 23.2.
Table 23.2: qf File Code Letters Code Meaning Version How Many BSection 23.9.1 Body type V8.6 and above At most one CSection 23.9.2 Controlling user V5.62 and above At most one per R line DSection 23.9.3, D line Data filename Obsolete as of V8.7 Exactly one ESection 23.9.4, E line Errors to V8.6 and earlier Many FSection 23.9.5, F line Flag bits V8.1 and above Many HSection 23.9.6, H line Header definition All versions Many ISection 23.9.8, K line df file’s inode number V8.7 and above Exactly one KSection 23.9.8 Time last processed V8.7 and above Exactly one MSection 23.9.9 Message (why queued) All versions At most one NSection 23.9.10, N line Number times tried V8.7 and above At most one PSection 23.9.11 Priority (current) All versions At most one QSection 23.9.12, Q line Original recipient V8.7 and above At most one per R line RSection 23.9.13 Recipient address All versions Many SSection 23.9.14 Sender address All versions Exactly one TSection 23.9.15 Time created All versions Exactly one VSection 23.9.16, V line Version V8.7 and above Exactly one ZSection 23.9.17, Z line DSN envelope ID V8.7 and above At most one $Section 23.9.18, $ line Restore macro value V8.6 and above At most one each .Section 23.9.19, . line End of qf file V8.7 and above At most one Some code letters may appear only once in a
qffile; others may appear many times. Any line that begins with a tab or space character is joined to the line above it. Empty lines are ignored. The order in which these lines appear in theqffile is important for the mailq command to work properly.We discuss the individual lines in the
qffile by code letters. Each letter is presented in alphabetical order rather than the order in which they should appear in theqffile.…
From an earlier section is [Wayback/Archive] [Chapter 23] 23.2 Parts of a Queued Message:
23.2 Parts of a Queued Message
When a message is stored in the queue, it is split into pieces. Each of those pieces is stored as a separate file in the queue directory. That is, the header and other information about the message are stored in one file, while the body (the data) is stored in another. All told, six different types of files may appear in the queue directory. The type of each is denoted by the first two letters of the filenames. Each filename begins with a single letter followed by an
fcharacter. The complete list is shown in Table 23.1.
Table 23.1: Queue File Types File Description dfSection 23.2.2, “The Data (Message Body) File: df” Data (message body) lfSection 23.2.3, “The Lock File (obsolete as of V5.62): lf” Lock file (obsolete as of V5.62) nfSection 23.2.4, “The ID Creation File (obsolete as of V5.62): nf” ID creation file (obsolete as of V5.62) tfSection 23.2.6, “The Temporary qf Rewrite Image: tf” Temporary qf rewrite image xfSection 23.2.7, “The Transcript File: xf” Transcript file qfSection 23.2.5, “The Queue Control File: qf” Queue control file (and headers) The complete form for each filename is
XfidentThe
Xis one of the leading letters shown in Table 23.1. Thefis the constant letterf. Theidentis a unique queue identifier associated with each mail message.In the following sections we first describe the identifier that is common to all the queue file parts, then describe each file type in alphabetical order. The internal details of the
qffile can vary depending on the version of sendmail, so it is discussed separately at the end of this chapter.…
Via:
- [Wayback/Archive] sendmail forward email from queue to different account – Google Search
- [Wayback/Archive] sendmail convert queue file to email – Google Search
- [Wayback/Archive] “sendmail” convert “data file” “queue file” to email – Google Search
- [Wayback/Archive] site:litux.nl/Books/Books/www.leothreads.com/e-book/oreillybookself/tcpip/sendmail “df File” – Google Search
Related:
- [Wayback/Archive] Jeroen Wiert Pluimers @wiert@mastodon.social on Twitter: “Does any of my tweeps know how to modify a sendmail que file (qf*) of a stuck email so it goes to a different recipient?”
- [Wayback/Archive] Jeroen Wiert Pluimers: “Does any of my fellow contacts…” – Mastodon
–jeroen






Leave a comment