greenmail-mail-test / greenmail

Official master for the Greenmail project
http://greenmail-mail-test.github.io/greenmail/
Apache License 2.0
618 stars 179 forks source link

Consider adding mode to test error handling #124

Open nbaksalyar opened 8 years ago

nbaksalyar commented 8 years ago

It would be nice if GreenMail had an option to explicitly define error responses to test error handling in user's code.

For example check MailHog, a fake SMTP server. It has a special mode to randomly reject connections, authentications, etc.

Another good example is Netflix's Chaos Monkey that is used to test distributed systems.

marcelmay commented 8 years ago

Thanks for the input.

We have something like this planned in #40 - where you can define event rules. Do you have any concrete error cases in mind?

nbaksalyar commented 8 years ago

Do you have any concrete error cases in mind?

I guess cases available in MailHog would be a good start:

  1. Reject connections (a socket exception);
  2. Reject authentication;
  3. Reject recipients (SMTPAddressFailedException);
  4. Reject senders (SMTPSenderFailedException).

These should cover most of the basic SMTP errors. I'm not sure about IMAP, though.