@Test
	void testMailFromRejectedFirst() throws IOException {
		when(messageHandlerFactory.create(any(MessageContext.class))).thenReturn(messageHandler, messageHandler2);
		doThrow(new RejectException("Test MAIL from rejected")).when(messageHandler).from(anyString());

		final SmartClient client = new SmartClient("localhost", smtpServer.getPort(), "localhost");

		try {
			client.from("john1@example.com");
			fail();
		} catch (final SMTPException e) {
			//expected to receive error
		}

		client.from("john2@example.com");
		client.quit();

		smtpServer.stop(); // wait for the server to catch up

		verify(messageHandlerFactory, times(2)).create(any(MessageContext.class));
		verify(messageHandler).from(anyString());
		verify(messageHandler).done();
		verify(messageHandler2).from(anyString());
		verify(messageHandler2).done();
		verifyNoMoreInteractions(messageHandlerFactory, messageHandler, messageHandler2);
	}
Test for issue 56: rejecting a Mail From causes IllegalStateException in the
next Mail From attempt.

@throws IOException        on IO error
src/test/java/de/gessnerfl/fakesmtp/smtp/server/MessageHandlerTest.java