Sendgrid has an inbound parse feature (https://sendgrid.com/docs/User_Guide/Settings/parse.html) which you can use to start building a framework - it takes any inbound email to a domain and forwards it as an HTTP request to an endpoint you specify. Used it for a few projects and its worked great.
It’s a full framework for handling almost everything a MUA would do (imap/pop, email parsing, mime parsing, sending email, etc), so yeah, it can do that. You’ll have a bunch of boiler plate code you’ll need, but a Google search will give you plenty of samples.