sipeed/picoclaw · error

deltachat configure (check email/password/server): %w

Error message

deltachat configure (check email/password/server): %w

What it means

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.

Source

Thrown at pkg/channels/deltachat/deltachat.go:1165

// configureAccount writes the managed account settings and runs the (network-bound)
// provider auto-configuration.
func (c *DeltaChatChannel) configureAccount(ctx context.Context, accountID int64) error {
	if c.config.Password.String() == "" {
		return c.passwordRequiredError("account is not configured")
	}

	cfgMap := accountConfigMap(c.config)
	if _, err := c.rpc.call(ctx, "batch_set_config", accountID, cfgMap); err != nil {
		return fmt.Errorf("deltachat set account config: %w", err)
	}

	logger.InfoCF("deltachat", "Configuring account (validating credentials)", map[string]any{
		"email": c.config.Email,
	})
	confCtx, cancel := context.WithTimeout(ctx, configureTimeout)
	defer cancel()
	if _, err := c.rpc.call(confCtx, "configure", accountID); err != nil {
		return fmt.Errorf("deltachat configure (check email/password/server): %w", err)
	}
	return nil
}

func (c *DeltaChatChannel) accountConfigChanged(ctx context.Context, accountID int64) (bool, error) {
	want := accountConfigMap(c.config)
	for _, key := range managedAccountConfigKeys {
		raw, err := c.rpc.call(ctx, "get_config", accountID, key)
		if err != nil {
			return false, fmt.Errorf("deltachat get config %s: %w", key, err)
		}
		var got *string
		if err := json.Unmarshal(raw, &got); err != nil {
			return false, fmt.Errorf("deltachat get config %s decode: %w", key, err)
		}
		if !accountConfigValueEqual(got, want[key]) {
			logger.InfoCF("deltachat", "Account config changed; reconfiguring", map[string]any{
				"email": c.config.Email,

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Verify the email/password pair with an independent IMAP client first
  2. Use an app-specific password where 2FA is enabled
  3. Set imap_server/imap_port and smtp_server/smtp_port explicitly so autoconfig can be skipped
  4. Open egress to the provider's IMAP/SMTP ports and check DNS
  5. If it wraps context.DeadlineExceeded, raise configureTimeout (deltachat.go:38)

Example fix

# before (channel_list config)
email: "bot@example.org"
password: "hunter2"

# after
email: "bot@example.org"
password: "app-specific-password"
imap_server: "imap.example.org"
imap_port: 993
smtp_server: "smtp.example.org"
smtp_port: 465
Defensive patterns

Strategy: try-catch

Validate before calling

// Cheap pre-check: validate IMAP credentials before letting the core configure
func imapLoginWorks(addr, password string) bool {
    conn, err := tls.Dial("tcp", imapsHost(addr), &tls.Config{Timeout: 10 * time.Second})
    if err != nil {
        return false
    }
    defer conn.Close()
    c := imapclient.New(conn)
    return c.Login(addr, password) == nil
}

Type guard

func isConfigureAuthFailure(err error) bool {
    return !errors.Is(err, context.DeadlineExceeded) &&
        (strings.Contains(err.Error(), "deltachat rpc error") || strings.Contains(err.Error(), "login"))
}

Try / catch

if err := c.configureAccount(ctx, accountID); err != nil {
    if errors.Is(err, context.DeadlineExceeded) {
        // slow provider/network: consider raising configureTimeout
    } else {
        // auth/provider problem: fix password or set imap/smtp servers explicitly; do not blind-retry
    }
    return err
}

Prevention

When it happens

Trigger: 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.

Common situations: Gmail/others without an app password, corporate mail that disables autoconfig endpoints, sandboxes blocking ports 993/465/143, typos in the address.

Related errors


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/6df224bfc6c69123. Report an issue: GitHub.