{"record":{"id":"c270d5521e27bcf7","repo":"phacility/phabricator","slug":"receiver-s-accepts-mail-to-s-but-is-not-a-s","errorCode":null,"errorMessage":"Receiver '%s' accepts mail to '%s', but is not a subclass of PhabricatorObjectMailReceiver.","messagePattern":"Receiver '(.+?)' accepts mail to '(.+?)', but is not a subclass of PhabricatorObjectMailReceiver\\.","errorType":"console","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php","lineNumber":152,"sourceCode":"        $possible_receiver = id(clone $possible_receiver)\n          ->setViewer($viewer)\n          ->setSender($user);\n\n        if (!$possible_receiver->canAcceptMail($pseudomail, $target)) {\n          continue;\n        }\n        $receiver = $possible_receiver;\n        break;\n      }\n\n      if (!$receiver) {\n        throw new Exception(\n          pht(\"No configured mail receiver can accept mail to '%s'.\", $to));\n      }\n\n      if (!($receiver instanceof PhabricatorObjectMailReceiver)) {\n        $class = get_class($receiver);\n        throw new Exception(\n          pht(\n            \"Receiver '%s' accepts mail to '%s', but is not a \".\n            \"subclass of PhabricatorObjectMailReceiver.\",\n            $class,\n            $to));\n      }\n\n      $object = $receiver->loadMailReceiverObject($to, $user);\n      if (!$object) {\n        throw new Exception(pht(\"No such object '%s'!\", $to));\n      }\n\n      $mail_key = PhabricatorMetaMTAMailProperties::loadMailKey($object);\n\n      $hash = PhabricatorObjectMailReceiver::computeMailHash(\n        $mail_key,\n        $user->getPHID());\n","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php#L134-L170","documentation":"A receiver did accept the mail (canAcceptMail returned true), but this workflow additionally requires an instanceof PhabricatorObjectMailReceiver, because it then calls loadMailReceiverObject() to compute object mail keys and the to+userID+hash@ addressing scheme. The accepting receiver class is not that subclass - typically a custom or extension receiver - so the workflow aborts rather than generate a malformed test.","triggerScenarios":"A custom PhabricatorMailReceiver subclass (extension inbound channel) responds to the --to address; receive-test only supports the built-in object receivers (tasks, revisions, etc.).","commonSituations":"Developing or installing third-party inbound channels; testing an address routed to a custom receiver.","solutions":["Test with a destination handled by a standard object receiver instead (e.g. --to T123).","If you maintain the custom receiver and it genuinely wraps an object, make it extend PhabricatorObjectMailReceiver (and implement loadMailReceiverObject).","Otherwise exercise custom receivers with their own test tooling rather than receive-test."],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":"function is_object_mail_receiver($receiver) {\n  return ($receiver instanceof PhabricatorObjectMailReceiver);\n}","tryCatchPattern":null,"preventionTips":["Use receive-test only against object-monogram or application-email destinations backed by object receivers.","Give custom receivers their own test tooling; document which workflows support them."],"tags":["phabricator","cli","mail","receiver","instanceof","extension"],"backgroundTag":"unsupported-receiver-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}