I wrote one of these years ago, as a front-end to my Exchange server. At the time Exchange had this thing where it ALWAYS accepted messages as long as the domain part was an accepted domain, and then it would do a fuzzy match on the mailbox names and dump the mail anywhere it felt matched.
So I had to have this SMTP front-end forwarder to weed out mis-addressed mail... which I eventually added SpamAssassin to as well. It ran for over 10 years without issue.
What I never solved/wrote was the TLS stuff, as it always seemed to complicated to code from scratch.
http://smtpd.github.io/qpsmtpd/
I'd reject spam at SMTP time, but also capture the rejected messages, so that users could view them in an online quarantine. Worked pretty well, though I think these days the original perl-based project has been reworked into a nodejs thing:
Outbound ISP SMTP servers should work that way. This makes email behave much like instant messaging.
Messages with many recipients may need to take a store and forward path. They can be redirected to a slow bulk mail server.
Historically, mail servers are store and forward because the destination might be offline, or on some store and forward UUCP system or something. Today, that's very rare. We don't have to emulate Sendmail forever.