Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My clientmqueue folder contains almost twice as many mails as what mailq -Ac shows as enqueued messages in that folder. When I look at them individually, it looks like the headers and the contents are stored in seperate files.

Is there a tool or different value to pass to mailq to where I can view the whole e-mails together? (especially the sender, receiver, subject and body)

share|improve this question

Most of the times your files in the queue directory will be x2 the messages in queue. There may also be files in the the queue directory that do not correspond to queued messages because they are left there as leftovers which for some reason were not erased after the queue was processed. If you observe the message identifiers and the queue file names you will see that they are linked. According to the "bat book" (page 396) the complete form for each filename is:


The X is one of the leading letters. The f is the constant letter f.The ident is a unique queue identifier associated with each mail message. About the leading letters now:

  • df - Data (message body)
  • lf - Lock file (obsolete and removed as of V5.62)
  • nf - ID creation file (obsolete and removed as of V5.62)
  • tf - Temporary qf rewrite image
  • xf - Transcript file
  • qf - Queue control file (and headers)

Armed with the above information you can script your way around the mailq output and do whatever you like. You may also want to check the sources of that comes with sendmail if you want to do elaborate stuff.

share|improve this answer

The value shown by the mailq command is correct. As you've surmised sendmail stores the message and its headers separately in the queue directory.

AFAIK there is no way to view the whole message using mailq - Its showing you a queue summary, it's not a tool for snooping into mail contents. The best you can do is cat the header & data file together to view them on the console (why you would want to do this, and the ethics of reading other people's mail are beyond me though...)

share|improve this answer
He may be having a lot of deferred messages in queue which may have spam characteristics... – adamo Mar 12 '12 at 6:32

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.