phacility/phabricator · info · PhutilArgumentUsageException
Use '--as' to specify the acting user.
Error message
Use '--as' to specify the acting user.
What it means
receive-test also needs an acting user. It only infers --as when --to resolved to an application email that has a default user configured; otherwise, with no --as given, it aborts with this usage hint before simulating delivery.
Source
Thrown at src/applications/metamta/management/PhabricatorMailManagementReceiveTestWorkflow.php:74
->executeOne();
$as = $args->getArg('as');
if (!$as && $to_application_email) {
$default_phid = $to_application_email->getConfigValue(
PhabricatorMetaMTAApplicationEmail::CONFIG_DEFAULT_AUTHOR);
if ($default_phid) {
$default_user = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
->withPHIDs(array($default_phid))
->executeOne();
if ($default_user) {
$as = $default_user->getUsername();
}
}
}
if (!$as) {
throw new PhutilArgumentUsageException(
pht("Use '--as' to specify the acting user."));
}
$user = id(new PhabricatorPeopleQuery())
->setViewer($this->getViewer())
->withUsernames(array($as))
->executeOne();
if (!$user) {
throw new PhutilArgumentUsageException(
pht("No such user '%s' exists.", $as));
}
$from = $args->getArg('from');
if (!$from) {
$from = $user->loadPrimaryEmail()->getAddress();
}
View on GitHub (pinned to 5720a38cfe)
Solutions
- Add --as <username> of a real Phabricator user: ./bin/mail receive-test --to T123 --as alincoln.
- If you want inference for an application address, configure the application email's default user so the workflow can pick it up.
- Check ./bin/mail help receive-test for exact flag names.
Example fix
# before ./bin/mail receive-test --to T123 # after echo 'reply body' | ./bin/mail receive-test --to T123 --as alincoln
Defensive patterns
Strategy: validation
Prevention
- Always pass --as when testing object monograms - inference only works for application emails with a default user.
- Keep a documented one-liner with both flags for your install's inbound testing.
When it happens
Trigger: Omitting --as while --to is an object monogram (object receivers have no default sender); --to is an application email with no default user configured; misspelling the flag.
Common situations: Testing object-mail addressing (e.g. T123+user+hash@...) which always needs an explicit actor; first runs against a freshly configured application email.
Related errors
- Use '%s' to specify the receiving object or email address.
- Use the '%s' flag to specify one or more messages to resend.
- Specify a device with --device.
- Specify a private key with --private-key.
- Specify a public key to trust with --id.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/a09524ac0b0adf56.
Report an issue: GitHub.