{"record":{"id":"9328e8d452dd870b","repo":"theonedev/onedev","slug":"subject-required-to-open-issue-via-email","errorCode":null,"errorMessage":"Subject required to open issue via email","messagePattern":"Subject required to open issue via email","errorType":"exception","errorClass":"ExplicitException","httpStatus":null,"severity":"error","filePath":"server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java","lineNumber":758,"sourceCode":"\t\t\t\t\t\t\t@Nullable User submitter, ParsedEmailAddress parsedSystemAddress, \n\t\t\t\t\t\t\tCollection<InternetAddress> receiverInternetAddresses) {\n\t\tString messageId = getMessageId(message);\n\t\tif (messageId != null) {\n\t\t\tvar existingIssue = issueService.findByMessageId(messageId);\n\t\t\tif (existingIssue != null) {\n\t\t\t\tlogger.warn(\"Ignored opening issue from message as issue with same message id already exists: {}\", \n\t\t\t\t\t\texistingIssue.getReference());\n\t\t\t\treturn existingIssue;\n\t\t\t}\n\t\t}\n\n\t\tIssue issue = new Issue();\n\t\tissue.setProject(project);\n\n\t\ttry {\n\t\t\tvar subject = message.getSubject();\n\t\t\tif (StringUtils.isBlank(subject)) {\n\t\t\t\tthrow new ExplicitException(\"Subject required to open issue via email\");\n\t\t\t} else if (subject.trim().toLowerCase().startsWith(\"re:\")) {\n\t\t\t\tthrow new ExplicitException(\"This address is intended to open issues, \" +\n\t\t\t\t\t\t\"however the message looks like a reply to some other email\");\n\t\t\t}\n\t\t\tissue.setTitle(subject);\n\t\t} catch (MessagingException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\t\n\t\tif (messageId != null)\n\t\t\tissue.setMessageId(messageId);\n\n\t\tString description = parseBody(message, project, issue.getUUID());\n\t\tif (StringUtils.isNotBlank(description)) \n\t\t\tdescription = stripSignature(description);\n\t\tif (StringUtils.isNotBlank(description))\n\t\t\tissue.setDescription(decorateContent(description));\n\t\t","sourceCodeStart":740,"sourceCodeEnd":776,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-core/src/main/java/io/onedev/server/mail/DefaultMailService.java#L740-L776","documentation":"When a new issue is created by sending an email to a project's issue mail address, the email subject becomes the issue title. OneDev requires a non-blank subject, and throws ExplicitException if it is missing.","triggerScenarios":"Sending an email with an empty or whitespace-only subject line to a project issue-creation email address.","commonSituations":"Composing a fresh email and leaving subject blank; some mail clients send subject-less mails for quick notes; automated systems generating emails without subjects.","solutions":["Set a non-blank subject line before sending to the issue email address","If sending programmatically, set message.setSubject(...) with a non-empty value","If the mail is not meant to create an issue, send it elsewhere than the issue address"],"exampleFix":"// before\nMimeMessage m = ...; // no subject set\n// after\nm.setSubject(\"Fix login page timeout\");","handlingStrategy":"validation","validationCode":"if (StringUtils.isBlank(message.getSubject())) throw new IllegalArgumentException(\"Subject required\");","typeGuard":null,"tryCatchPattern":"try { issueService.openViaEmail(message); } catch (ExplicitException e) { bounce(e.getMessage()); }","preventionTips":["Always set a subject when emailing the issue address","Programmatic sends: assert subject before send","Educate users that subject = issue title"],"tags":["email","issues","validation"],"backgroundTag":"empty-required-field","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}