I have a backup mail server in case of a failure on the main one. In that case of failure, mails come on the backup server and stay there until the main one is back.

If I wait some times, the delivery will be done automatically as soon as the main server is back but it can be long. So how to force a send retry of all the mails?

For exemple : postqueue -p : give me a list of mails

I then tried postqueue -f (from man page : Flush the queue: attempt to deliver all queued mail.). It surely flushed the queue but mails were not been delivered...

  • seems -f is flush and -q is queue (send the queue) – m3nda Apr 9 '15 at 5:32
  • 1
    there is no postqueue -q. There is sendmail -q to support sendmail syntax so postfix can completely replace sendmail, but that's a synonym. The different letters are jsut because postfix chose different ones than sendmail did. – Johannes H. Apr 24 '15 at 18:15
  • Sorry again, comment on the same day :) so both are wrong. – m3nda Apr 24 '15 at 20:45

According to postqueue(1) you can simply run postqueue -f to flush your mail queue. If the mails aren't delivered after flushing the queue but are being requeued instead, you might want to check your mail logs for errors.

Taking a peek at postsuper(1) might also be helpful. Maybe the messages are on hold and need to be released first.


postqueue -f should work. If it does not, it has a good reason for that. Check the logs. Also pfqueue is a very useful command for inspecting mail spool.


sendmail -q retries delivery of all mails in the queue immediately.

  • Isn't this the same as running postqueue -f ? – Dalibor Filus May 30 '14 at 12:22
  • 2
    @NoICE it is. From the docs: -q Attempt to deliver all queued mail. This is implemented by executing the postqueue(1) command. – the-wabbit May 30 '14 at 18:26
  • I didn't check for that, but seems -f is flush and -q is queue. One tries to send then the other just clean the queue. It's better to try deliver i guess. – m3nda Apr 9 '15 at 5:31
  • 1
    @erm3nda You shoudl at least check the man pages first. From the postqueue man page: "-f Flush the queue: attempt to deliver all queued mail. This option implements the traditional "sendmail -q" command, by contacting the Postfix qmgr(8) daemon." => they are synonym and do exactly the same. " – Johannes H. Apr 24 '15 at 18:11
  • @JohannesH. Doh... sorry, you're right about i should read it. Thank you for the correction. – m3nda Apr 24 '15 at 20:44

postqueue -s domain.tld should cause the backup relay machine to flush all the email for your site. The default setup for postfix enables per-site flushing for all domains in relay_domains. postqueue -f will do this too, but will also push out mail for external sites, i.e. it does more than you need.

How are you determining that mail has not been delivered? Are they still on the backup host or have they been sent to the main host and then got lost?


I'm usually using this command

postsuper -r ALL && postqueue -f

-r ALL is requeue all message
-f is Flush the queue: attempt to deliver all queued mail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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