Class: ActionMailbox::Ingresses::Cloudflare::InboundEmailsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/cloudflare/email_service/action_mailbox.rb

Overview

Receives the raw RFC822 message a Cloudflare Email Worker forwards and hands it to Action Mailbox for routing. The Worker signs each request (HMAC-SHA256 over “<timestamp>.<body>”); we verify the signature and reject stale timestamps before accepting the message.

Instance Method Summary collapse

Instance Method Details

#createObject



21
22
23
24
25
26
27
28
# File 'lib/cloudflare/email_service/action_mailbox.rb', line 21

def create
  if raw_body.empty?
    head :unprocessable_entity
  else
    ActionMailbox::InboundEmail.create_and_extract_message_id!(raw_body)
    head :no_content
  end
end