{"record":{"id":"625f671c8bbbf7e4","repo":"phacility/phabricator","slug":"mailer-key-s-is-not-configured-or-does-not-s","errorCode":null,"errorMessage":"Mailer key (\"%s\") is not configured, or does not support outbound messages of type \"%s\". Available mailers are: %s.","messagePattern":"Mailer key \\(\"(.+?)\"\\) is not configured, or does not support outbound messages of type \"(.+?)\"\\. Available mailers are: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php","lineNumber":205,"sourceCode":"\n    $mailers = PhabricatorMetaMTAMail::newMailers(\n      array(\n        'media' => array($type),\n        'outbound' => true,\n      ));\n    $mailers = mpull($mailers, null, 'getKey');\n\n    if (!$mailers) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No configured mailers support outbound messages of type \"%s\".',\n          $type));\n    }\n\n    $mailer_key = $args->getArg('mailer');\n    if ($mailer_key !== null) {\n      if (!isset($mailers[$mailer_key])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Mailer key (\"%s\") is not configured, or does not support '.\n            'outbound messages of type \"%s\". Available mailers are: %s.',\n            $mailer_key,\n            $type,\n            implode(', ', array_keys($mailers))));\n      }\n\n      $mail->setTryMailers(array($mailer_key));\n    }\n\n    foreach ($attach as $attachment) {\n      $data = Filesystem::readFile($attachment);\n      $name = basename($attachment);\n      $mime = Filesystem::getMimeType($attachment);\n      $file = new PhabricatorMailAttachment($data, $name, $mime);\n      $mail->addAttachment($file);\n    }","sourceCodeStart":187,"sourceCodeEnd":223,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementSendTestWorkflow.php#L187-L223","documentation":"`--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.","triggerScenarios":"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.","commonSituations":"Multiple mailers configured and keys misremembered; mailer entries renamed during config cleanup; per-environment cluster.mailers divergence.","solutions":["Copy the key verbatim from the exception's 'Available mailers are:' list.","If the key is correct, open cluster.mailers and check that entry's `\"outbound\"` and media configuration against your --type.","Drop --mailer to let Phabricator choose any eligible mailer."],"exampleFix":"// before\n$ bin/mail send-test --to alincoln --mailer ses1\n// Exception: Mailer key (\"ses1\") is not configured... Available mailers are: ses-1.\n\n// after\n$ bin/mail send-test --to alincoln --mailer ses-1","handlingStrategy":"validation","validationCode":"// Verify the key passes the same outbound+media filter before using it:\n$mailers = mpull(\n  PhabricatorMetaMTAMail::newMailers(array('media' => array($type), 'outbound' => true)),\n  null,\n  'getKey');\nif (!isset($mailers[$mailer_key])) {\n  fwrite(STDERR, sprintf(\"Mailer '%s' unavailable. Available: %s\\n\", $mailer_key, implode(', ', array_keys($mailers))));\n  exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy mailer keys from `bin/config get cluster.mailers`, not from memory.","Name mailers deterministically (e.g. ses-1, twilio-1) and keep names stable across environments.","Smoke-test a specific mailer right after adding or renaming it."],"tags":["php","phabricator","cli","configuration","mail"],"backgroundTag":"invalid-mailer-key","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}