theonedev/onedev · error · ExplicitException
Invalid recipient address:
Error message
Invalid recipient address:
What it means
The inbound mail handler parses the recipient address of an incoming message to route it to the correct issue or pull request. If the To/Cc address cannot be parsed or resolved to a known mail receiver address, an ExplicitException is thrown.
Source
Thrown at server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java:560
bindings.put("pullRequest", involvedPullRequest);
String htmlBody = EmailTemplates.evalTemplate(true, template, bindings);
String textBody = EmailTemplates.evalTemplate(false, template, bindings);
var threadingReferences = getThreadingReferences(UUID.randomUUID().toString(), getMessageId(message));
sendMailAsync(newArrayList(fromInternetAddress.getAddress()), newArrayList(), newArrayList(),
subject, htmlBody, textBody, null, null, threadingReferences);
} else {
if (!SecurityUtils.canReadCode(involvedPullRequest.getProject())) {
addComment(involvedPullRequest, message, fromInternetAddress, fromUser, receiverInternetAddresses);
} else {
throw new UnauthorizedException("Code read permission required for project: %s"
+ involvedPullRequest.getProject().getPath());
}
}
} else {
throw new ExplicitException("No account found with verified email address: " + fromInternetAddress.getAddress());
}
} else {
throw new ExplicitException("Invalid recipient address: " + parsedReceiverAddress);
}
}
} else {
logger.warn("Ignored recipient '" + parsedReceiverAddress + "' as issue or pull request is processed");
}
} else if (!receiverInternetAddress.equals(fromInternetAddress)) {
involvedInternetAddresses.add(receiverInternetAddress);
}
if (involvedIssue != null) {
for (InternetAddress involvedInternetAddress : involvedInternetAddresses) {
EmailAddress involvedAddressEntity = emailAddressService.findByValue(involvedInternetAddress.getAddress());
if (involvedAddressEntity != null && involvedAddressEntity.isVerified()) {
var involvedUser = involvedAddressEntity.getOwner();
if (SecurityUtils.canAccessProject(involvedUser.asSubject(), involvedIssue.getProject())) {
if (involvedIssue.isConfidential())
issueAuthorizationService.authorize(involvedIssue, involvedUser);
issueWatchService.watch(involvedIssue, involvedUser, true);View on GitHub (pinned to d44925c47c)
Solutions
- Verify the issue/pull request email address format configured in administration settings and send to the exact address
- Check that the monitored mailbox does not receive unrelated mail via forwarding rules
- Confirm the mail monitor 'receiver address pattern' matches the domain used
- Remove or correct any forwarding that sends arbitrary mail to the OneDev inbox
Example fix
// before To: issues@wrong-domain.example // after To: issues@onedev-correct-domain.example (matches configured mail address pattern)
Defensive patterns
Strategy: validation
Validate before calling
boolean routed = parsedReceiverAddress != null && parsedReceiverAddress.matches(configuredMailAddressPattern);
Try / catch
try { handleMessage(msg); } catch (ExplicitException e) { logger.warn("Skipping mail: " + e.getMessage()); } Prevention
- Send to the exact issue/PR address from the UI
- Avoid forwarding unrelated mail to the monitored mailbox
- Keep the receiver address pattern aligned with the mail domain
When it happens
Trigger: An email arrives at the monitored mailbox whose recipient address does not match a configured issue/pull request email address pattern (e.g. malformed address, wrong domain, unrelated mail forwarded to the monitored inbox).
Common situations: Mail forwarding rules deliver unrelated messages to the OneDev monitored mailbox; misconfigured mail address prefix in server settings; recipients typing the issue email address by hand with typos; multiple domains where only one is configured.
Understand the failure class
Background: "Invalid URL" errors: why new URL(), URI.parse, and reqwest::Url reject your string — missing scheme, whitespace, and bad path format — this error's family across 39 libraries.
Related errors
- No account found with verified email address:
- Unrecognized command:
- Unable to discover cluster ip from database connection url:
- Time tracking needs to be enabled for the project
- Link spec not found: ${linkName}
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/ee7594480df4fe31.
Report an issue: GitHub.