Billionmail/BillionMail · error
sender email is required
Error message
sender email is required
What it means
validateAlertSettings (used by SetBlacklistAlertSettings) requires a non-empty SenderEmail because alert notifications must have a From address. An empty string fails the first check and the settings are not saved.
Source
Thrown at core/internal/controller/settings/settings_v1_set_blacklist_alert_settings.go:68
jsonData, err := json.MarshalIndent(data, "", " ")
if err != nil {
res.SetError(gerror.Newf(public.LangCtx(ctx, "Failed to encode alert settings: {}", err.Error())))
return res, nil
}
err = gfile.PutContents(alertSettingsFile, string(jsonData))
if err != nil {
res.SetError(gerror.Newf(public.LangCtx(ctx, "Failed to save alert settings: {}", err.Error())))
return res, nil
}
res.SetSuccess(public.LangCtx(ctx, "Alert settings saved successfully and test email sent"))
return res, nil
}
func validateAlertSettings(settings *v1.SetBlacklistAlertSettingsReq) error {
if settings.SenderEmail == "" {
return fmt.Errorf("sender email is required")
}
if !strings.Contains(settings.SenderEmail, "@") {
return fmt.Errorf("invalid sender email format")
}
if settings.SMTPServer == "" {
return fmt.Errorf("SMTP server is required")
}
if settings.SMTPPort < 1 || settings.SMTPPort > 65535 {
return fmt.Errorf("SMTP port must be between 1 and 65535")
}
if settings.SMTPPassword == "" {
return fmt.Errorf("SMTP password is required")
}
View on GitHub (pinned to fc36c76c05)
Solutions
- Provide a valid sender email, e.g. alerts@example.com
- Enable the sender field as required in the UI and validate before submit
- Trim the input and reject whitespace-only values client-side
- Use an address on a domain the mail server can send from (SPF/DKIM configured)
Example fix
// before
{ "senderEmail": "" }
// after
{ "senderEmail": "alerts@example.com" } Defensive patterns
Strategy: validation
Validate before calling
const sender = (settings.senderEmail ?? '').trim();
if (!sender) throw new Error('sender email is required'); Type guard
function hasSenderEmail(s: unknown): s is { senderEmail: string } {
return typeof s === 'object' && s !== null && typeof (s as any).senderEmail === 'string' && (s as any).senderEmail.trim() !== '';
} Try / catch
try {
await api.setBlacklistAlertSettings(settings);
} catch (e) {
if (String(e.message).includes('sender email is required')) {
notify('Sender email is a required field');
focusSenderField();
} else throw e;
} Prevention
- Mark sender email required in the form UI
- Trim and reject whitespace-only input before submit
- Coerce null/undefined to '' and check before calling the API
- Default to a sensible address like alerts@<your-domain> when appropriate
When it happens
Trigger: Calling SetBlacklistAlertSettings with senderEmail omitted, set to "", or whitespace-only in the request body.
Common situations: Frontend forms submitted without filling the sender field, API scripts that skip optional-looking fields, or clients that send null which deserializes to the empty string.
Understand the failure class
Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.
Related errors
- invalid sender email format
- SMTP server is required
- invalid recipient email format: %s
- required column 'email' not found
- You cannot create more than 5000 batches
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/b66876c48592486b.
Report an issue: GitHub.