{"record":{"id":"192239b5855dcb2f","repo":"phacility/phabricator","slug":"use-s-to-specify-the-receiving-object-or-email","errorCode":null,"errorMessage":"Use '%s' to specify the receiving object or email address.","messagePattern":"Use '(.+?)' to specify the receiving object or email address\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"info","filePath":"src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php","lineNumber":47,"sourceCode":"            'param'   => 'object',\n            'help'    => pht('Simulate mail delivery \"To:\" the given object.'),\n          ),\n          array(\n            'name' => 'cc',\n            'param' => 'address',\n            'help' => pht('Simulate a mail delivery \"Cc:\" address.'),\n            'repeat' => true,\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n    $console = PhutilConsole::getConsole();\n\n    $to = $args->getArg('to');\n    if (!$to) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"Use '%s' to specify the receiving object or email address.\",\n          '--to'));\n    }\n\n    $to_application_email = id(new PhabricatorMetaMTAApplicationEmailQuery())\n      ->setViewer($this->getViewer())\n      ->withAddresses(array($to))\n      ->executeOne();\n\n    $as = $args->getArg('as');\n    if (!$as && $to_application_email) {\n      $default_phid = $to_application_email->getConfigValue(\n        PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR);\n      if ($default_phid) {\n        $default_user = id(new PhabricatorPeopleQuery())\n          ->setViewer($this->getViewer())\n          ->withPHIDs(array($default_phid))","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php#L29-L65","documentation":"'bin/mail receive-test' simulates an inbound message, so it must know the destination: the --to flag (an object monogram like T123 or an application email address). The workflow checked $args->getArg('to') up front, found nothing, and halted with this PhutilArgumentUsageException before doing any work.","triggerScenarios":"Running ./bin/mail receive-test without --to; passing the target under a different flag name (e.g. --recipient); scripts that build the command line and drop the flag.","commonSituations":"First-time use of the receive-test workflow; commands copy-pasted from docs or tickets with the flag stripped.","solutions":["Re-run with --to, e.g. ./bin/mail receive-test --to T123 or --to reviews@example.com.","Also supply the required acting user with --as <username> and pipe the raw message on stdin.","See ./bin/mail help receive-test for the full flag list."],"exampleFix":"# before\n./bin/mail receive-test --as alincoln\n\n# after\necho 'reply body' | ./bin/mail receive-test --to T123 --as alincoln","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["receive-test needs both --to and --as; check flags before scripting the command.","Run ./bin/mail help receive-test when unsure of the contract."],"tags":["phabricator","cli","mail","usage-error"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}