{"record":{"id":"ee7594480df4fe31","repo":"theonedev/onedev","slug":"invalid-recipient-address","errorCode":null,"errorMessage":"Invalid recipient address: ","messagePattern":"Invalid recipient address: ","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java","lineNumber":560,"sourceCode":"\t\t\t\t\t\t\t\t\t\t\tbindings.put(\"pullRequest\", involvedPullRequest);\n\t\t\t\t\t\t\t\t\t\t\tString htmlBody = EmailTemplates.evalTemplate(true, template, bindings);\n\t\t\t\t\t\t\t\t\t\t\tString textBody = EmailTemplates.evalTemplate(false, template, bindings);\n\t\t\t\t\t\t\t\t\t\t\tvar threadingReferences = getThreadingReferences(UUID.randomUUID().toString(), getMessageId(message));\n\t\t\t\t\t\t\t\t\t\t\tsendMailAsync(newArrayList(fromInternetAddress.getAddress()), newArrayList(), newArrayList(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tsubject, htmlBody, textBody, null, null, threadingReferences);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tif (!SecurityUtils.canReadCode(involvedPullRequest.getProject())) {\n\t\t\t\t\t\t\t\t\t\t\t\taddComment(involvedPullRequest, message, fromInternetAddress, fromUser, receiverInternetAddresses);\n\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tthrow new UnauthorizedException(\"Code read permission required for project: %s\" \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ involvedPullRequest.getProject().getPath());\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tthrow new ExplicitException(\"No account found with verified email address: \" + fromInternetAddress.getAddress());\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tthrow new ExplicitException(\"Invalid recipient address: \" + parsedReceiverAddress);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tlogger.warn(\"Ignored recipient '\" + parsedReceiverAddress + \"' as issue or pull request is processed\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (!receiverInternetAddress.equals(fromInternetAddress)) {\n\t\t\t\t\t\tinvolvedInternetAddresses.add(receiverInternetAddress);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (involvedIssue != null) {\n\t\t\t\t\t\tfor (InternetAddress involvedInternetAddress : involvedInternetAddresses) {\n\t\t\t\t\t\t\tEmailAddress involvedAddressEntity = emailAddressService.findByValue(involvedInternetAddress.getAddress());\n\t\t\t\t\t\t\tif (involvedAddressEntity != null && involvedAddressEntity.isVerified()) {\n\t\t\t\t\t\t\t\tvar involvedUser = involvedAddressEntity.getOwner();\n\t\t\t\t\t\t\t\tif (SecurityUtils.canAccessProject(involvedUser.asSubject(), involvedIssue.getProject())) {\n\t\t\t\t\t\t\t\t\tif (involvedIssue.isConfidential())\n\t\t\t\t\t\t\t\t\t\tissueAuthorizationService.authorize(involvedIssue, involvedUser);\n\t\t\t\t\t\t\t\t\tissueWatchService.watch(involvedIssue, involvedUser, true);","sourceCodeStart":542,"sourceCodeEnd":578,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java#L542-L578","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nTo: issues@wrong-domain.example\n// after\nTo: issues@onedev-correct-domain.example  (matches configured mail address pattern)","handlingStrategy":"validation","validationCode":"boolean routed = parsedReceiverAddress != null && parsedReceiverAddress.matches(configuredMailAddressPattern);","typeGuard":null,"tryCatchPattern":"try { handleMessage(msg); } catch (ExplicitException e) { logger.warn(\"Skipping mail: \" + e.getMessage()); }","preventionTips":["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"],"tags":["email","mail-handler","configuration"],"backgroundTag":"invalid-url-format","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}