phacility/phabricator · error · PhutilArgumentUsageException

No configured mailers support outbound messages of type "%s"

Error message

No configured mailers support outbound messages of type "%s".

What it means

Before sending, the workflow calls PhabricatorMetaMTAMail::newMailers() with `outbound => true` and a media filter of the selected message type, and the result was empty: no configured mailer both accepts outbound duty and supports the chosen medium. The mailer set comes from cluster.mailers configuration, so this exception means the configuration, not the command line, is the problem.

Source

Thrown at src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php:196

      $mail->setHTMLBody($body);
    } else {
      $mail->setBody($body);
    }

    if ($from) {
      $mail->setFrom($from->getPHID());
    }

    $mailers = PhabricatorMetaMTAMail::newMailers(
      array(
        'media' => array($type),
        'outbound' => true,
      ));
    $mailers = mpull($mailers, null, 'getKey');

    if (!$mailers) {
      throw new PhutilArgumentUsageException(
        pht(
          'No configured mailers support outbound messages of type "%s".',
          $type));
    }

    $mailer_key = $args->getArg('mailer');
    if ($mailer_key !== null) {
      if (!isset($mailers[$mailer_key])) {
        throw new PhutilArgumentUsageException(
          pht(
            'Mailer key ("%s") is not configured, or does not support '.
            'outbound messages of type "%s". Available mailers are: %s.',
            $mailer_key,
            $type,
            implode(', ', array_keys($mailers))));
      }

      $mail->setTryMailers(array($mailer_key));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Run `bin/config get cluster.mailers` and confirm at least one entry has `"outbound": true` and a media list covering your type.
  2. Retest with the default email type (omit --type) to see whether any outbound mailer exists at all.
  3. Add or fix the mailer entry (SMTP/SES/SendGrid for email, Twilio-like adapter for SMS) and re-run.
  4. Verify the host you run bin/mail on reads the same configuration as the web nodes.

Example fix

// before (cluster.mailers)
[{ "key": "ses-1", "type": "ses", "inbound": true, "outbound": false }]
// $ bin/mail send-test --to alincoln
// Exception: No configured mailers support outbound messages of type "email".

// after
[{ "key": "ses-1", "type": "ses", "inbound": true, "outbound": true }]
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight the same filter the workflow applies:
$mailers = PhabricatorMetaMTAMail::newMailers(array(
  'media' => array($type),
  'outbound' => true,
));
if (!$mailers) {
  fwrite(STDERR, "No outbound mailer for media '{$type}'. Check cluster.mailers.\n");
  exit(1);
}

Try / catch

try {
  // invoke the workflow
} catch (PhutilArgumentUsageException $ex) {
  // configuration problem, not a typo: inspect cluster.mailers next
  fwrite(STDERR, $ex->getMessage()."\n");
  exit(1);
}

Prevention

When it happens

Trigger: `--type sms` with no SMS-capable mailer (e.g. Twilio) in cluster.mailers; every mailer entry marked `"outbound": false`; cluster.mailers empty or not loaded (e.g. configured in the wrong file/environment); a mailer whose media list omits the selected type.

Common situations: Testing SMS before the SMS provider is configured; fresh installs where only inbound addresses were set up; copy-pasted cluster.mailers JSON that dropped the outbound bit; configuration applied to web nodes but not the host running bin/mail.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/8a8f17a3779bd59a. Report an issue: GitHub.