Pitching my own: https://github.com/mjl-/mox has a "mox localserve" subcommand that runs a mail server on localhost for testing, including a pedantic mode and special addresses that cause failure conditions you may want to test for. This is actually a full mail server (SMTP, IMAP and much more) and it comes with a webmail client. The "localserve" mode was just so easy to implement that I couldn't resist.