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

  1. Set cli.Email to a valid address before calling Apply
  2. Pass a non-empty --email flag on the apply command
  3. 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

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


AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05). Data as JSON: /api/errors/65fafa51007345b5. Report an issue: GitHub.