Billionmail/BillionMail · error
email is required
Error message
email is required
What it means
Parameter check in AcmeCLI.Validate: the AcmeCLI builder was used without calling an email setter (or with an empty string), and ACME certificate authorities require a contact email for certificate issuance, so the validation aborts before any acme.sh command runs.
Source
Thrown at core/internal/service/acme/cli.go:86
/**
* @brief Set HTTP verification
* @return *AcmeCLI
*/
func (cli *AcmeCLI) SetHTTPVerification() *AcmeCLI {
cli.VerifyType = "http"
cli.DnsProvider = ""
cli.DnsConfig = nil
return cli
}
/**
* @brief Validate parameters
* @return error
*/
func (cli *AcmeCLI) Validate() error {
// Check email
if cli.Email == "" {
return fmt.Errorf("email is required")
}
// Check domains
if len(cli.Domains) == 0 {
return fmt.Errorf("at least one domain is required")
}
// Check verification type
if cli.VerifyType != "http" && cli.VerifyType != "dns" {
return fmt.Errorf("verification type must be either 'http' or 'dns'")
}
// Check DNS provider if using DNS verification
if cli.VerifyType == "dns" {
if cli.DnsProvider == "" {
return fmt.Errorf("DNS provider is required for DNS verification")
}
View on GitHub (pinned to fc36c76c05)
Solutions
- Set cli.Email to a valid address before calling Apply
- Pass a non-empty --email flag on the apply command
- Load the email from config/env and fail fast with a clear message if blank
Example fix
// before
cli := &AcmeCLI{Domains: []string{"example.com"}, VerifyType: "http"}
cli.Apply(ctx)
// after
cli := &AcmeCLI{Email: "admin@example.com", Domains: []string{"example.com"}, VerifyType: "http"}
if err := cli.Validate(); err != nil { log.Fatal(err) }
cli.Apply(ctx) Defensive patterns
Strategy: validation
Validate before calling
func requireEmail(email string) error {
if strings.TrimSpace(email) == "" { return errors.New("email is required") }
if !strings.Contains(email, "@") { return errors.New("email is not a valid address") }
return nil
} Try / catch
if err := cli.Validate(); err != nil {
if strings.Contains(err.Error(), "email is required") {
flag.Usage() // show the missing --email flag
}
os.Exit(1)
} Prevention
- Always call Validate() before Apply() to fail fast with a clear message
- Make --email a required CLI flag (error at parse time)
- Source the email from a validated config file or env var
- Keep a default ops mailbox for certificate notifications
When it happens
Trigger: Constructing AcmeCLI (directly or via applyCommand flag parsing) and calling Validate/Apply without setting Email, or passing an empty --email flag.
Common situations: Automated scripts omitting the email flag; config-driven invocation where the email key is missing or blank; copying example code that leaves Email unset.
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
- at least one domain is required
- Unsupported DNS provider: {}
- verification type must be either 'http' or 'dns'
- DNS provider is required for DNS verification
- unsupported DNS provider: %s, supported providers: %s
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/65fafa51007345b5.
Report an issue: GitHub.