Billionmail/BillionMail · error
Decode password failed: %w
Error message
Decode password failed: %w
What it means
Thrown by AddImport when a mailbox record carries an encrypted PasswordEncode but no plaintext Password, and PasswdDecode fails to decrypt the stored encoded password. The decoded plaintext is then needed for md5-crypt hashing, so the import aborts.
Source
Thrown at core/internal/service/mail_boxes/mail_boxes.go:385
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)
if err != nil {
err = fmt.Errorf("Generate password md5-crypt failed: %w", err)
return
}
}
} else {
mailbox.PasswordEncode = PasswdEncode(ctx, mailbox.Password)
mailbox.Password, err = PasswdMD5Crypt(ctx, mailbox.Password)
if err != nil {
err = fmt.Errorf("Generate password md5-crypt failed: %w", err)
return
}View on GitHub (pinned to fc36c76c05)
Solutions
- Ensure the encryption key/secret used by PasswdEncode/PasswdDecode matches the one that encrypted the source PasswordEncode value
- Re-export the source data from the original environment with matching keys, or reset the password and import plaintext Password instead
- Verify the PasswordEncode value is not truncated or corrupted in the import source
Defensive patterns
Strategy: validation
Validate before calling
if mailbox.PasswordEncode != "" && mailbox.Password == "" {
// verify decode key matches source environment before importing
if _, err := PasswdDecode(ctx, mailbox.PasswordEncode); err != nil {
// reset password or re-export with matching key
}
} Prevention
- Use the same encryption key across export and import environments
- Prefer importing plaintext Password and letting the server encode it
- Validate PasswordEncode values round-trip before bulk imports
When it happens
Trigger: Calling ImportMailbox (via AddImport) with PasswordEncode set, Password empty, and PasswdDecode failing — typically because PasswordEncode was encrypted with a different key than the one configured at import time.
Common situations: Migrating mailbox data between deployments with different encryption keys/secrets; corrupted or hand-edited PasswordEncode values; importing records exported from another BillionMail instance.
Related errors
- password length must be at least 4 characters
- DNS automated resolution failed: ClientID, ClientSecret or T
- DNS automated resolution failed: APIKey or APISecret is empt
- Failed to get configuration
- Failed to create ACME client: {}
AI-assisted analysis of Billionmail/BillionMail@fc36c76c05 (2026-09-05).
Data as JSON: /api/errors/31f8765e6668fd13.
Report an issue: GitHub.