theonedev/onedev · error · ExplicitException
Unable to create issue from email as service desk is not ena
Error message
Unable to create issue from email as service desk is not enabled
What it means
When an inbound email targets a project's system address without a subaddress (no issue/PR reference), OneDev tries to open a new issue via the service desk. If the project has no ServiceDeskSetting configured, handleMessage throws this ExplicitException because creating issues from email requires the service desk feature to be enabled.
Source
Thrown at server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java:476
PullRequest involvedPullRequest = null;
Collection<InternetAddress> involvedInternetAddresses = new HashSet<>();
List<InternetAddress> receiverInternetAddresses = new ArrayList<>();
receiverInternetAddresses.addAll(asList(toInternetAddresses));
receiverInternetAddresses.addAll(asList(getAddresses(message, "Cc")));
for (InternetAddress receiverInternetAddress : receiverInternetAddresses) {
ParsedEmailAddress parsedReceiverAddress = ParsedEmailAddress.parse(receiverInternetAddress.getAddress());
var project = findProject(systemAddress, parsedReceiverAddress);
if (project != null) {
if (isOriginatedFromOneDev(message)) {
logger.warn("Ignored opening issue from message as it is originated from OneDev");
} else {
var serviceDeskSetting = settingService.getServiceDeskSetting();
if (serviceDeskSetting != null) {
logger.debug("Creating issue via email (project: {})...", project.getPath());
involvedIssue = openIssue(message, project, fromInternetAddress, fromUser, parsedSystemAddress, receiverInternetAddresses);
} else {
throw new ExplicitException("Unable to create issue from email as service desk is not enabled");
}
}
} else if (parsedReceiverAddress.isSubaddress() && systemAddress.equalsIgnoreCase(parsedReceiverAddress.getOriginalAddress())) {
if (involvedIssue == null && involvedPullRequest == null) {
String subAddress = StringUtils.substringAfter(parsedReceiverAddress.getName(), "+");
if (subAddress.equals(MailService.TEST_SUB_ADDRESS)) {
break;
} else if (subAddress.contains("~")) {
Long entityId;
try {
entityId = Long.parseLong(StringUtils.substringAfter(subAddress, "~"));
} catch (NumberFormatException e) {
throw new ExplicitException("Invalid id specified in recipient address: " + parsedReceiverAddress);
}
if (subAddress.contains("issue")) {
involvedIssue = issueService.get(entityId);
if (involvedIssue == null)
throw new ExplicitException("Non-existent issue specified in recipient address: " + parsedReceiverAddress);View on GitHub (pinned to d44925c47c)
Solutions
- Enable service desk for the target project (Project -> Service Desk setting) in OneDev admin/project settings.
- Send the email to an existing issue's subaddress instead (issue~<id>@...).
- Reply to an existing issue/PR thread so the message is associated rather than creating a new issue.
Example fix
// project setting: enable service desk // before: no serviceDeskSetting for project // after: set Setting.getServiceDeskSetting() via ProjectServiceDeskSetting with mailbox configured
Defensive patterns
Strategy: validation
Validate before calling
var sd = settingService.getServiceDeskSetting();
if (sd == null) throw new IllegalStateException("Enable service desk before emailing this project address"); Try / catch
try { mailHandler.handle(message); } catch (ExplicitException e) { mailService.sendMail(from, ..., "Could not process your email: " + e.getMessage(), ...); } Prevention
- Enable service desk for projects that receive email
- Document the project email address only when the feature is on
- Reply to existing issue threads when unsure
When it happens
Trigger: An email is sent to a project system address; the project is resolved but serviceDeskSetting is null and the message is not a reply to an existing issue or pull request.
Common situations: User emails a project address expecting an issue to be created, but the admin never enabled Service Desk for that project; service desk disabled after previously being on.
Related errors
- This email address is already used by another user
- Issue schedule permission required to set iterations
- Iteration '${iterationName}' not found
- No permission to update issue fields
- State is required
AI-assisted analysis of theonedev/onedev@d44925c47c (2026-09-06).
Data as JSON: /api/errors/e17d85e218b87586.
Report an issue: GitHub.