{"record":{"id":"e3055cf4d5ddf13c","repo":"Billionmail/BillionMail","slug":"invalid-recipient-email-format-s","errorCode":null,"errorMessage":"invalid recipient email format: %s","messagePattern":"invalid recipient email format: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/controller/settings/settings_v1_set_blacklist_alert_settings.go","lineNumber":93,"sourceCode":"\tif settings.SMTPServer == \"\" {\n\t\treturn fmt.Errorf(\"SMTP server is required\")\n\t}\n\n\tif settings.SMTPPort < 1 || settings.SMTPPort > 65535 {\n\t\treturn fmt.Errorf(\"SMTP port must be between 1 and 65535\")\n\t}\n\n\tif settings.SMTPPassword == \"\" {\n\t\treturn fmt.Errorf(\"SMTP password is required\")\n\t}\n\n\tif len(settings.RecipientList) == 0 {\n\t\treturn fmt.Errorf(\"at least one recipient is required\")\n\t}\n\n\tfor _, recipient := range settings.RecipientList {\n\t\tif !strings.Contains(recipient, \"@\") {\n\t\t\treturn fmt.Errorf(\"invalid recipient email format: %s\", recipient)\n\t\t}\n\t}\n\n\treturn nil\n}\n\nfunc testSMTPConnectionWithRelay(ctx context.Context, settings *v1.SetBlacklistAlertSettingsReq) error {\n\t//g.Log().Infof(ctx, \"Testing SMTP connection to %s:%d\", settings.SMTPServer, settings.SMTPPort)\n\n\tresult := relay.TestSmtpConnection(\n\t\tsettings.SMTPServer,\n\t\tfmt.Sprintf(\"%d\", settings.SMTPPort),\n\t\tsettings.SenderEmail,\n\t\tsettings.SMTPPassword,\n\t)\n\n\tif !result.Success {\n\t\treturn fmt.Errorf(\"%s\", result.Message)","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/controller/settings/settings_v1_set_blacklist_alert_settings.go#L75-L111","documentation":"Each entry in RecipientList is sanity-checked with strings.Contains(recipient, \"@\"). A recipient without an @ sign is not a valid email address and causes validation to abort, echoing the offending value in the message.","triggerScenarios":"Calling SetBlacklistAlertSettings where any string in recipientList lacks the '@' character (e.g. 'adminexample.com', a bare name, or a comma-joined string 'a@x.com,b@x.com').","commonSituations":"User pastes a comma-separated list into a single input instead of adding one per field; whitespace or name-only entries; CSV upload where the email column was misparsed.","solutions":["Split comma/semicolon-separated input into individual addresses before sending, trimming whitespace.","Remove or correct the entry named in the error message so it is a full address like user@domain.com.","Optionally strengthen the server check to a regex/net/mail.ParseAddress to catch more malformed formats."],"exampleFix":"// before\nrecipientList: [\"admin@example.com,ops@example.com\"]\n// after\nrecipientList: [\"admin@example.com\", \"ops@example.com\"]","handlingStrategy":"validation","validationCode":"const emailRe = /^[^@\\s]+@[^@\\s]+\\.[^@\\s]+$/\nfor (const r of payload.recipientList) {\n  if (!emailRe.test(r.trim())) throw new Error(`Invalid recipient email: ${r}`)\n}","typeGuard":"function isEmail(v: unknown): v is string {\n  return typeof v === 'string' && v.includes('@') && v.trim() === v && v.length > 3\n}","tryCatchPattern":"try {\n  await api.setBlacklistAlertSettings(payload)\n} catch (e) {\n  const m = String(e).match(/invalid recipient email format: (.+)/)\n  if (m) showFormError('recipients', `Fix this address: ${m[1]}`)\n}","preventionTips":["Split pasted comma/semicolon lists into individual addresses client-side","Trim whitespace from every entry before submitting","Use net/mail.ParseAddress-equivalent validation (regex or library) instead of a bare '@' check"],"tags":["validation","email","config"],"backgroundTag":"invalid-email-format","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}