{"record":{"id":"b15f05fbadbde423","repo":"Billionmail/BillionMail","slug":"password-not-found-for-s","errorCode":null,"errorMessage":"password not found for %s","messagePattern":"password not found for (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/internal/service/mail_service/sending.go","lineNumber":160,"sourceCode":"\t\treturn\n\t}\n\n\tif !es.IsConfigured() {\n\t\terr = errors.New(\"Email Sender not configured\")\n\t\treturn\n\t}\n\n\treturn\n}\n\n// PasswordPlainByEmail\nfunc PasswordPlainByEmail(ctx context.Context, email string) (string, error) {\n\tval, err := g.DB().Model(\"mailbox\").Where(\"username\", email).Value(\"password_encode\")\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"query password failed: %w\", err)\n\t}\n\tif val.IsEmpty() {\n\t\treturn \"\", fmt.Errorf(\"password not found for %s\", email)\n\t}\n\trawHex, err := hex.DecodeString(val.String())\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"hex decode failed: %w\", err)\n\t}\n\tplainBytes, err := base64.StdEncoding.DecodeString(string(rawHex))\n\tif err != nil {\n\t\treturn \"\", fmt.Errorf(\"base64 decode failed: %w\", err)\n\t}\n\treturn string(plainBytes), nil\n}\n\n// Close closes the SMTP connection\nfunc (e *EmailSender) Close() {\n\t_ = e.Disconnect()\n}\n\n// Connect establishes an SMTP connection","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/Billionmail/BillionMail/blob/fc36c76c050c3775c5e899faf7403cf0262d2744/core/internal/service/mail_service/sending.go#L142-L178","documentation":"PasswordPlainByEmail found no mailbox row (or an empty password_encode) for the requested username, so val.IsEmpty() triggers 'password not found for %s'. This means the sender address has no corresponding local mailbox with stored credentials.","triggerScenarios":"NewEmailSenderWithLocal is given an email address that doesn't exist in the mailbox table, or the row's password_encode is NULL/empty — e.g. sending from an alias or an externally-hosted address with no local account.","commonSituations":"Typo in the From address; mailbox deleted but still referenced as sender; mailbox created without a password; using an address managed by an external provider.","solutions":["Confirm the sender address exists: SELECT username FROM mailbox WHERE username='<email>'.","Create the mailbox or set its password if the row is missing/empty.","Fix the From address in your send call to a configured mailbox.","Check password_encode is populated (hex-encoded value), not NULL after provisioning."],"exampleFix":"// before\nfrom := \"noreply@mydomain.com\"\n// after\nfrom := \"noreply@mydomain.com\" // must exist in mailbox table\n// create it if absent:\n// INSERT INTO mailbox (username, password_encode, ...) VALUES ('noreply@mydomain.com', <encoded>, ...)","handlingStrategy":"validation","validationCode":"n, err := g.DB().Model(\"mailbox\").Where(\"username\", fromAddress).Count()\nif err != nil || n == 0 {\n    return fmt.Errorf(\"sender %s has no mailbox; create it or choose a configured sender\", fromAddress)\n}","typeGuard":null,"tryCatchPattern":"sender, err := NewEmailSenderWithLocal(ctx, fromAddress)\nif err != nil {\n    if strings.Contains(err.Error(), \"password not found for\") {\n        return fmt.Errorf(\"no mailbox for %s — provision it or use an existing sender\", fromAddress)\n    }\n    return err\n}","preventionTips":["Only allow From addresses that exist in the mailbox table (dropdown instead of free text).","Provision the mailbox and its password before using the address as a sender.","Audit for deleted mailboxes still referenced in campaign settings."],"tags":["mailbox","smtp","password","configuration"],"backgroundTag":"mailbox-password-not-found","analyzedSha":"fc36c76c050c3775c5e899faf7403cf0262d2744","analyzedAt":"2026-09-05T21:28:54.019Z","contentChangedAt":"2026-09-05T21:28:54.019Z","schemaVersion":2},"datasetVersion":"2026-09-12T22:17:10.623Z"}