Postfix - how to retry delivery of mail in queue?

Solution 1:

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.

Solution 2:

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.

Solution 3:

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

Solution 4:

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?

Solution 5:

I'm usually using this command

postsuper -r ALL && postqueue -f

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