phacility/phabricator · error · Exception

Failed to parse object address ("%s") during processing.

Error message

Failed to parse object address ("%s") during processing.

What it means

In PhabricatorObjectMailReceiver::processReceivedMail(), matchObjectAddress() failed to re-parse the target address that had already been accepted by canAcceptMail(). The source comment marks this 'a surprise': it indicates inconsistent matching logic (nearly always in a custom receiver subclass) rather than bad input, and throws a plain Exception.

Source

Thrown at src/applications/metamta/receiver/PhabricatorObjectMailReceiver.php:38

   * this pattern is some sort of object ID.
   *
   * @param   string          A string matched by @{method:getObjectPattern}
   *                          fragment.
   * @param   PhabricatorUser The viewing user.
   * @return  void
   */
  abstract protected function loadObject($pattern, PhabricatorUser $viewer);


  final protected function processReceivedMail(
    PhabricatorMetaMTAReceivedMail $mail,
    PhutilEmailAddress $target) {

    $parts = $this->matchObjectAddress($target);
    if (!$parts) {
      // We should only make it here if we matched already in "canAcceptMail()",
      // so this is a surprise.
      throw new Exception(
        pht(
          'Failed to parse object address ("%s") during processing.',
          (string)$target));
    }

    $pattern = $parts['pattern'];
    $sender = $this->getSender();

    try {
      $object = $this->loadObject($pattern, $sender);
    } catch (PhabricatorPolicyException $policy_exception) {
      throw new PhabricatorMetaMTAReceivedMailProcessingException(
        MetaMTAReceivedMailStatus::STATUS_POLICY_PROBLEM,
        pht(
          'This mail is addressed to an object ("%s") you do not have '.
          'permission to see: %s',
          $pattern,
          $policy_exception->getMessage()));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Audit any local overrides of matchObjectAddress()/canAcceptMail() for divergent logic and make both use one shared matcher.
  2. Reproduce with `bin/mail show-inbound --id N` to see the exact target address being parsed.
  3. If no local customizations exist, report upstream including the target address from the exception.
Defensive patterns

Strategy: try-catch

Try / catch

try {
  $received->processReceivedMail();
} catch (Exception $ex) {
  // log the target address and receiver class with the exception;
  // this error signals a matching-logic inconsistency, not user error
  phlog($ex);
}

Prevention

When it happens

Trigger: A custom PhabricatorObjectMailReceiver subclass whose canAcceptMail()/matchObjectAddress() use different patterns or normalization, so an address accepted by one is rejected by the other; address normalization (case, domain, plus-addressing) changing between the two calls.

Common situations: Developing custom reply handlers or overriding object-address matching in extensions; upstream changes to matching combined with local overrides that were not updated.

Understand the failure class

Related errors


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