class ActionMailer::Base

def receive(raw_mail)

end
end
# ...
def receive(mail)
class MyMailer < ActionMailer::Base

as a parameter:
need to implement a +receive+ method that accepts the raw email string
If you want your mailer to be able to process incoming messages, you'll

object's +receive+ method.
instantiates a new mailer, and passes the email object to the mailer
Receives a raw email, parses it into an email object, decodes it,
def receive(raw_mail)
  ActiveSupport::Deprecation.warn(<<~MESSAGE.squish)
    ActionMailer::Base.receive is deprecated and will be removed in Rails 6.1.
    Use Action Mailbox to process inbound email.
  MESSAGE
  ActiveSupport::Notifications.instrument("receive.action_mailer") do |payload|
    mail = Mail.new(raw_mail)
    set_payload_for_mail(payload, mail)
    new.receive(mail)
  end
end