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

I'm testing a moderately high volume (eventually possibly up to 100,000 or so) of emails in a script I'm writing. I'm generating a list of emails that will end up in one of my accounts and having the script process them, and it's working pretty well, but for right now I just want to make sure sendmail is receiving the right number of requests without actually sending any mail.

I've got sendmail turned off and when I run the script I get the expected number of requests in the deferred queue (when I run mailq I get the right number of requests marked "(Deferred: Connection refused by [])").

I know if I had sendmail running and wanted to delete the messages that were actually queued I could delete the contents of /var/spool/mqueue (I'm on an Ubuntu 10.04 LTS machine). However with sendmail turned off there's nothing in mqueue, and when I turn sendmail on it starts to send all of those emails, I can't delete them from mqueue as fast as sendmail processes them.

Is there any way for me to delete them from the backlog with sendmail turned off so I don't accidentally send some? Right now if they get sent it's no big deal (again they all end up in my mailbox), but I would like to test it with an actual set of test data, and it's important that those emails not get inadvertently spammed.

share|improve this question
up vote 3 down vote accepted

Sendmail transfers the mails to queue once they've been treated, so if sendmail is off they can't go to mqueue on time as you're experiencing.

Check /var/spool/clientmqueue which is where sendmail stores the e-mails before forwarding them over, that should do the trick for you ;)

share|improve this answer
awesome, thanks! On Ubuntu 10.04.1 LTS it's mqueue-client, but sure enough, there they all are! – cori Jan 25 '11 at 11:25

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.