Billionmail/BillionMail · error

Failed to create any mailbox

Error message

Failed to create any mailbox

What it means

Thrown by BatchAdd when the transaction succeeded but the collected emailList is empty, meaning zero mailboxes were actually created despite the request. It guards against silently returning success with no results, typically caused by all rows being ignored by InsertIgnore (e.g. all duplicates).

Source

Thrown at core/internal/service/mail_boxes/mail_boxes.go:371

					_ = ensureMaildirAndQuotaFile(context.Background(), &mb)
				}(mb)
			}

			for i := 0; i < cap(sem); i++ {
				sem <- struct{}{}
			}
		}(mailboxes)

		return nil
	})

	if err != nil {

		return nil, fmt.Errorf("Failed to create email: %w", err)
	}

	if len(emailList) == 0 {
		return nil, fmt.Errorf("Failed to create any mailbox")
	}

	return emailList, nil
}

// AddImport
func AddImport(ctx context.Context, mailbox *v1.Mailbox) (err error) {

	if mailbox.PasswordEncode != "" {

		if mailbox.Password == "" {
			mailbox.Password, err = PasswdDecode(ctx, mailbox.PasswordEncode)
			if err != nil {
				err = fmt.Errorf("Decode password failed: %w", err)
				return
			}

			mailbox.Password, err = PasswdMD5Crypt(ctx, mailbox.Password)

View on GitHub (pinned to fc36c76c05)

Solutions

  1. Check whether the target mailboxes already exist; use unique prefixes or new usernames
  2. Verify the count parameter passed to BatchAddMailbox is > 0
  3. Inspect emailList generation logic if prefixes are dynamic but yield duplicates
Defensive patterns

Strategy: validation

Validate before calling

if count <= 0 { return errors.New("count must be positive") }
if prefix == "" { return errors.New("prefix is required") }

Prevention

When it happens

Trigger: BatchAddMailbox where InsertIgnore skipped every row (all generated emails already exist) or the email generation produced no entries.

Common situations: Re-running the same batch request with identical prefixes/counts so every generated address collides with existing mailboxes; off-by-one or empty count inputs.

Related errors


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