Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'd like to stress my Postfix servers, and I need to make a huge amount of sendings, but of course, I don't want to send spam to any real address, and I don't my IP's to be blacklisted.

Is there any way of configuring postfix this way?

share|improve this question
up vote 1 down vote accepted

From here

One of the questions that you will want to solve is how much mail traffic can your hardware handle. This is often why people overbuild hardware is that they just are not sure and no one wants to build a mail server and then rebuild in 3 months. Fortunately, Postfix comes with a couple programs that you can stress your server with and get a general idea of what you need.

Hardware Considerations - When you are building a mail server, especially if you are building a mail server that will host multiple domains, it is very difficult to determine the necessary hardware as growth is unknown in two areas. First, growth in terms of new domains or new accounts on the mail server is tough because business can change and staff may change dramatically in a 6 month period. When you build the mail server you want to build something that will potentially provide 3 years of service, maybe 5. So you must compensate for the amount of growth for your business. Second, growth is difficult to estimate based on the amount of Spam your server must be capable of managing. This is a very frustrating aspect of mail servers in that potentially, Spam could triple in 3 months and it would have very little to do with how you are managing your mail server, so you must also prepare for these kinds of issues. Spam is especially hard on resources as you will be running a programs like Spamassassin and an anti-virus program like ClamAv on each of these emails that hits your system.

Stress Test - The program smtp-source will use port 25 to simulate mail coming to your mail server to process. In this simulation you can perform messages by themselves or in parallel. There are several settings that you can modify to help determine the stress level that your server will best perform at. In order to run the test you may have to comment out a few lines in your smtpd restrictions.

smtpd_recipient_restrictions = warn_if_reject reject_non_fqdn_recipient
#   reject_non_fqdn_sender
#   reject_unknown_sender_domain reject_unknown_recipient_domain permit_mynetworks reject_unauth_destination reject_non_fqdn_hostname reject_invalid_hostname
#   check_helo_access pcre:/etc/postfix/helo_checks check_sender_mx_access cidr:/etc/postfix/bogus_mx reject_rbl_client reject_unverified_sender permit

Parallel sessions – This will indicate the number of concurrent sessions or maxprocesses that your server will be running.

Message size – You can test various message sizes to simulate the mail that you typically will receive on your server.

Total messages – You can determine the total messages that you will test on receiving.

Display counter -This will just show a counter as the messages are received while the command is running.

# time /usr/sbin/smtp-source -s 20 -l 5120 -m 100 -c -f -t localhost:25  100

real    0m2.664s user    0m0.020s sys    0m0.100s

This example shows 20 parallel sessions (-s 20), 5KB sized messages (-l 5120), 100 messages ent (-m 100), counter display (-c), envelope sender and receiver (-f -t and connection on port 25 of the localhost (localhost:25). The “100” indicates the total messages sent. The real time (0m2.664s ) is the time the injection took,. Here is an additional test on the same server that indicates an increase to 40 sessions, 10 KB mail size and 500 messages. This gives you a way to evaluate the additional load on the server in terms of a comparison time.

# time /usr/sbin/smtp-source -s 40 -l 10120 -m 500 -c -f -t localhost:25  500

real    0m29.795s user    0m0.200s sys    0m0.530s
share|improve this answer
Answers with only a link to content are strongly discouraged. What happens when that link goes dead? Your answer becomes worthless. Please provide content here and link to the source for more detail. – EEAA May 29 '12 at 16:10

This command is beautiful for #StressTest #Performance #CapacityPlanning

# time /usr/sbin/smtp-source -s 20 -l 5120 -m 100 -c -f -t localhost:25  100

real    0m2.664s user    0m0.020s sys    0m0.100s

In my case: (Debian Weezy) the "100" at the final not corresponding with the syntax.

# time /usr/sbin/smtp-source -s 20 -l 5120 -m 100 -c -f -t localhost:25

real    0m2.664s user    0m0.020s sys    0m0.100s
share|improve this answer

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.