Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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...

share|improve this question

4 Answers 4

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.

share|improve this answer
+1 worked for me! –  HaydnWVN Nov 30 '12 at 13:50
+1 worked for me too! –  Reado Mar 30 '13 at 7:25

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.

share|improve this answer

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?

share|improve this answer

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

share|improve this answer
Isn't this the same as running postqueue -f ? –  NoICE May 30 '14 at 12:22
@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

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.