Class: Protege::MtaDomainsSyncsController

Inherits:
ApplicationController show all
Defined in:
app/controllers/protege/mta_domains_syncs_controller.rb

Overview

Pushes the whole domain manifest to the self-hosted MTA on demand — the console "Sync now" button.

Domain changes already re-provision automatically (+EmailDomain+ enqueues MailProvisioningJob on commit); this manual re-push is for recovery — e.g. after the accessory was rebooted, or to confirm the MTA holds the current keys. Nested under a domain for context, but the push is always the full manifest (the MTA needs complete state), so the specific domain in the URL is incidental.

Instance Method Summary collapse

Instance Method Details

#createvoid

This method returns an undefined value.

Push the manifest and return to the domain. Serves POST /email_domains/:email_domain_id/mta_domains_sync.



15
16
17
18
19
20
# File 'app/controllers/protege/mta_domains_syncs_controller.rb', line 15

def create
  result = Gateway.push_mail_provisioning

  redirect_to email_domain_path(params[:email_domain_id]),
              flash: { (result[:ok] ? :notice : :alert) => result[:message] }
end