Back to Mailhog

JIM

docs/JIM.md

1.0.11.8 KB
Original Source

Introduction to Jim

Jim is the MailHog Chaos Monkey, inspired by Netflix.

You can invite Jim to the party using the invite-jim flag:

MailHog -invite-jim

With Jim around, things aren't going to work how you expect.

What can Jim do?

  • Reject connections
  • Rate limit connections
  • Reject authentication
  • Reject senders
  • Reject recipients

It does this randomly, but within defined parameters.

You can control these using the following command line flags:

FlagDefaultDescription
-invite-jimfalseSet to true to invite Jim
-jim-disconnect0.005Chance of randomly disconnecting a session
-jim-accept0.99Chance of accepting an incoming connection
-jim-linkspeed-affect0.1Chance of applying a rate limit
-jim-linkspeed-min1024Minimum link speed (in bytes per second)
-jim-linkspeed-max10240Maximum link speed (in bytes per second)
-jim-reject-sender0.05Chance of rejecting a MAIL FROM command
-jim-reject-recipient0.05Chance of rejecting a RCPT TO command
-jim-reject-auth0.05Chance of rejecting an AUTH command

If you enable Jim, you enable all parts. To disable individual parts, set the chance of it happening to 0, e.g. to disable connection rate limiting:

MailHog -invite-jim -jim-linkspeed-affect=0

Examples

Always rate limit to 1 byte per second:

MailHog -invite-jim -jim-linkspeed-affect=1 -jim-linkspeed-max=1 -jim-linkspeed-min=1

Disconnect clients after approximately 5 commands:

MailHog -invite-jim -jim-disconnect=0.2

Simulate a mobile connection (at 10-100kbps) for 10% of clients:

MailHog -invite-jim -jim-linkspeed-affect=0.1 -jim-linkspeed-min=1250 -jim-linkspeed-max=12500