Mass Emails Sending From Bash Script in Linux

To prevent abuse and don't allow to send bulk emails through SMTP server, it is recommended to restrict the number of messages that each user can send.

Let's say we have limited the number of messages to send, but how can we check that the limitation works?

The best way to make such check is to try to send mass emails, as spammers usually do, using our SMTP server as relay.

From the Linux Command Line, we can create a simple Bash Script that can send multiple emails for testing purposes.

Sending Bulk Emails for Testing Purposes

Use the following Bash Script from your Linux machine to send 1000 emails to example@mail.tld :

for i in {1..1000}; do
	echo "Test" | $(which mail) -s "Test Message №$i" "example@mail.tld"