What tools can I use to simulate email traffic and stress test a Postfix cluster?
Summary
What email marketers say8Marketer opinions
Email marketer from Email Geeks shares that if you send actual emails, you're also stress testing your regular mail server, which might cause trouble. Also shares that in the past, he spun up a temporary mail server to handle inbound mail and just delete _most_ of them immediately, then set his outbound mail server to use that receiver as a gateway.
Email marketer from LinuxQuestions.org recommends a simple tool called 'mail бомбер' that can be used to quickly generate lots of test traffic, for basic traffic simulation.
Email marketer from Stack Overflow suggests using `swaks` to send emails to the Postfix server and measure the time it takes to process them. This helps in load testing and identifying performance bottlenecks.
Email marketer from DigitalOcean provides a tutorial on how to install and use swaks. Swaks is a command-line SMTP test tool which can be used to test, verify and troubleshoot SMTP setups.
Email marketer from linuxcommand.org mentions mail command which can be used for sending system messages or quick mail between users. You can combine the mail command with shell scripts to send multiple emails for stress testing.
Email marketer from Experts Exchange mentions a multithreaded email sender tool that can simulate traffic loads for a Postfix setup. He says the name of the specific tool is not so important, rather its ability to simulate traffic effectively.
Email marketer from Reddit suggests writing custom Python scripts using libraries like `smtplib` to generate and send a large volume of emails to the Postfix server. They emphasize controlling sending rate and content variability.
Email marketer from ServerFault recommends using a dummy SMTP server, like MailHog, to capture the generated email traffic instead of sending actual emails. This prevents potential spam issues and allows analyzing email content and headers.
What the experts say3Expert opinions
Expert from Word to the Wise, Laura Atkins, explains that you can simulate sending emails to blocklist honeypots as a form of stress testing. This helps understand how your mail infrastructure reacts and what triggers blocklisting, simulating real-world deliverability challenges.
Expert from Email Geeks explains that using `smtp-sink` won’t bear any resemblance to real world performance, though, as it doesn’t take into account delivery or dns latency.
Expert from Email Geeks shares that Postfix comes with a server called `smtp-sink` which will accept and throw away as much mail as you want.
What the documentation says4Technical articles
Documentation from Postfix.org explains that the smtp-sink(8) program implements a Postfix SMTP server that produces no output, not even in the logs. This program is useful for stress-testing Postfix, or for testing Postfix integration with content filters.
Documentation from Apache.org details how JMeter can be configured to send emails using SMTP sampler, allowing simulation of email traffic for load and stress testing.
Documentation from Nping.org shares how to utilize Nping to craft SMTP packets and probe the Postfix server. It allows sending custom commands and analyzing the response times and server behavior.
Documentation from The grong shares that Floodnsmtp is designed to allow easy simulations of network behaviour when sending a large volume of emails. The floodnsmtp utility floods the specified SMTP server with mails generated from the command-line options or from a file.