phacility/phabricator · warning · PhutilArgumentUsageException

Mailer key ("%s") is not configured, or does not support out

Error message

Mailer key ("%s") is not configured, or does not support outbound messages of type "%s". Available mailers are: %s.

What it means

`--mailer` names a key that is not in the outbound-plus-media-filtered mailer map. Either no mailer with that key is configured at all, or a mailer with that key exists but is inbound-only or does not support the selected message type. The exception lists the keys that did pass the filter, so it distinguishes 'typo' from 'wrong capabilities' for you.

Source

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

    $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));
    }

    foreach ($attach as $attachment) {
      $data = Filesystem::readFile($attachment);
      $name = basename($attachment);
      $mime = Filesystem::getMimeType($attachment);
      $file = new PhabricatorMailAttachment($data, $name, $mime);
      $mail->addAttachment($file);
    }

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Copy the key verbatim from the exception's 'Available mailers are:' list.
  2. If the key is correct, open cluster.mailers and check that entry's `"outbound"` and media configuration against your --type.
  3. Drop --mailer to let Phabricator choose any eligible mailer.

Example fix

// before
$ bin/mail send-test --to alincoln --mailer ses1
// Exception: Mailer key ("ses1") is not configured... Available mailers are: ses-1.

// after
$ bin/mail send-test --to alincoln --mailer ses-1
Defensive patterns

Strategy: validation

Validate before calling

// Verify the key passes the same outbound+media filter before using it:
$mailers = mpull(
  PhabricatorMetaMTAMail::newMailers(array('media' => array($type), 'outbound' => true)),
  null,
  'getKey');
if (!isset($mailers[$mailer_key])) {
  fwrite(STDERR, sprintf("Mailer '%s' unavailable. Available: %s\n", $mailer_key, implode(', ', array_keys($mailers))));
  exit(1);
}

Prevention

When it happens

Trigger: Typo in the key (`--mailer ses1` vs configured `ses-1`); referencing a mailer configured with `"outbound": false`; combining `--type sms` with `--mailer` pointing at an email-only adapter (SMTP/SES); a key copied from a different environment.

Common situations: Multiple mailers configured and keys misremembered; mailer entries renamed during config cleanup; per-environment cluster.mailers divergence.

Related errors


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