Leonti
Leonti

Reputation: 10950

Sendmail disable outgoing mails temporarily

I want to perform a load test on a server but application sends emails as part of the testing.

I'm not interested in knowing if mails are coming through, but I don't want to get into spam blacklist while performing the test.

So, is there a way to disable outgoing emails in sendmail but still simulating load on the system? For example how do I tell sendmail to store outgoing mail in a directory instead of actually sending it?

I know I could just comment mail() function in application source and I will do it as a last resort but it wouldn't simulate load on sendmail while testing. Or can I just assume it would be insignificant? (about 4-5 emails per second)

Leonty

Upvotes: 3

Views: 1861

Answers (1)

bcosca
bcosca

Reputation: 17555

exec('/etc/init.d/sendmail stop);`

Disk I/O caused by saving mail instead of sending it will skew your traffic/load measurements. Just forward all sendmail output to a dummy SMTP server on your network instead - one that doesn't send mail at all.

Upvotes: 2

Related Questions