{"record":{"id":"6df224bfc6c69123","repo":"sipeed/picoclaw","slug":"deltachat-configure-check-email-password-server","errorCode":null,"errorMessage":"deltachat configure (check email/password/server): %w","messagePattern":"deltachat configure \\(check email/password/server\\): %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/deltachat/deltachat.go","lineNumber":1165,"sourceCode":"// configureAccount writes the managed account settings and runs the (network-bound)\n// provider auto-configuration.\nfunc (c *DeltaChatChannel) configureAccount(ctx context.Context, accountID int64) error {\n\tif c.config.Password.String() == \"\" {\n\t\treturn c.passwordRequiredError(\"account is not configured\")\n\t}\n\n\tcfgMap := accountConfigMap(c.config)\n\tif _, err := c.rpc.call(ctx, \"batch_set_config\", accountID, cfgMap); err != nil {\n\t\treturn fmt.Errorf(\"deltachat set account config: %w\", err)\n\t}\n\n\tlogger.InfoCF(\"deltachat\", \"Configuring account (validating credentials)\", map[string]any{\n\t\t\"email\": c.config.Email,\n\t})\n\tconfCtx, cancel := context.WithTimeout(ctx, configureTimeout)\n\tdefer cancel()\n\tif _, err := c.rpc.call(confCtx, \"configure\", accountID); err != nil {\n\t\treturn fmt.Errorf(\"deltachat configure (check email/password/server): %w\", err)\n\t}\n\treturn nil\n}\n\nfunc (c *DeltaChatChannel) accountConfigChanged(ctx context.Context, accountID int64) (bool, error) {\n\twant := accountConfigMap(c.config)\n\tfor _, key := range managedAccountConfigKeys {\n\t\traw, err := c.rpc.call(ctx, \"get_config\", accountID, key)\n\t\tif err != nil {\n\t\t\treturn false, fmt.Errorf(\"deltachat get config %s: %w\", key, err)\n\t\t}\n\t\tvar got *string\n\t\tif err := json.Unmarshal(raw, &got); err != nil {\n\t\t\treturn false, fmt.Errorf(\"deltachat get config %s decode: %w\", key, err)\n\t\t}\n\t\tif !accountConfigValueEqual(got, want[key]) {\n\t\t\tlogger.InfoCF(\"deltachat\", \"Account config changed; reconfiguring\", map[string]any{\n\t\t\t\t\"email\": c.config.Email,","sourceCodeStart":1147,"sourceCodeEnd":1183,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/deltachat/deltachat.go#L1147-L1183","documentation":"The 'configure' JSON-RPC call failed. This step makes deltachat-core run network-bound provider autoconfiguration (resolve IMAP/SMTP parameters for the email domain) and validate the login; it is bounded by configureTimeout (90s). The message explicitly names the usual suspects: email, password, or server settings.","triggerScenarios":"Wrong mail_pw (auth failure), provider without autoconfig and no explicit imap/smtp settings, firewall blocking IMAP/SMTP egress, DNS failure, account requiring 2FA/app-specific password, or the 90s confCtx deadline expiring on a slow path.","commonSituations":"Gmail/others without an app password, corporate mail that disables autoconfig endpoints, sandboxes blocking ports 993/465/143, typos in the address.","solutions":["Verify the email/password pair with an independent IMAP client first","Use an app-specific password where 2FA is enabled","Set imap_server/imap_port and smtp_server/smtp_port explicitly so autoconfig can be skipped","Open egress to the provider's IMAP/SMTP ports and check DNS","If it wraps context.DeadlineExceeded, raise configureTimeout (deltachat.go:38)"],"exampleFix":"# before (channel_list config)\nemail: \"bot@example.org\"\npassword: \"hunter2\"\n\n# after\nemail: \"bot@example.org\"\npassword: \"app-specific-password\"\nimap_server: \"imap.example.org\"\nimap_port: 993\nsmtp_server: \"smtp.example.org\"\nsmtp_port: 465","handlingStrategy":"try-catch","validationCode":"// Cheap pre-check: validate IMAP credentials before letting the core configure\nfunc imapLoginWorks(addr, password string) bool {\n    conn, err := tls.Dial(\"tcp\", imapsHost(addr), &tls.Config{Timeout: 10 * time.Second})\n    if err != nil {\n        return false\n    }\n    defer conn.Close()\n    c := imapclient.New(conn)\n    return c.Login(addr, password) == nil\n}","typeGuard":"func isConfigureAuthFailure(err error) bool {\n    return !errors.Is(err, context.DeadlineExceeded) &&\n        (strings.Contains(err.Error(), \"deltachat rpc error\") || strings.Contains(err.Error(), \"login\"))\n}","tryCatchPattern":"if err := c.configureAccount(ctx, accountID); err != nil {\n    if errors.Is(err, context.DeadlineExceeded) {\n        // slow provider/network: consider raising configureTimeout\n    } else {\n        // auth/provider problem: fix password or set imap/smtp servers explicitly; do not blind-retry\n    }\n    return err\n}","preventionTips":["Pre-validate credentials with an IMAP client before enabling the channel","Set explicit imap_server/smtp_server for providers without reliable autoconfig","Use app-specific passwords on 2FA accounts"],"tags":["deltachat","imap","smtp","authentication","network","go"],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}