Linux – Postfix – how to add emails to the queue without being delivered

emailemail-serverlinuxpostfix

I have a quick question. How does one add emails to Postfix's queue without it delivering the emails? I am writing a script to email Postfix statistics (queue count, sent, etc) to our support staff. I want to test it when there are emails in Postfix's queue to see if its working correctly. However, every time I send an email from Postfix it gets delivered. 🙂

Thanks!

Best Answer

Some methods:

  • Use @EightBitTony's approach
  • Use a VM for development and pull the virtual plug to the network
  • Use a firewall rule to drop outgoing packets for port 25.

and the best way:

Related Topic