I wanted to fetch emails from an IMAP or POP3 account, and send them to my Rails app with all the benefits from the ActionMailbox, but I couldn't seem to find a well-defined way to do this.
So, I ended up looking at the source of the relay ingress
Here we can see how the controller takes the raw email source and creates the InboundEmail:
ActionMailbox::InboundEmail.create_and_extract_message_id! request.body.read