title: Configurable mail server mock for JUnit tests?
body: <p>I'm looking for a mail server mock that can be configured like a Mockito mock object.
  Currently we are using <a href="http://www.icegreen.com/greenmail/" rel="nofollow">GreenMail</a> as mail server mock, but I would like to do something like this in my unit tests:</p>
  
  <blockquote>
    <ul>
    <li>if mail with subject xyz arrives, accept.</li>
    <li>if mail with subject zz1 arrives, send temporarily failure</li>
    <li>if mail with subject fh2 arrives, send bounce (unknown recipient).</li>
    <li>.....</li>
    </ul>
  </blockquote>
  
  <p>As I can see, <a href="http://www.icegreen.com/greenmail/" rel="nofollow">GreenMail</a> is not capable of this.
  Does anyone knows a library which can do something like this?</p>