sipeed/picoclaw · error

deltachat: email is required. Next step: choose one of the c

Error message

deltachat: email is required.
Next step: choose one of the chatmail servers below and set channel_list.deltachat.settings.email to %q, or use the same @server form with another chatmail relay. Run `picoclaw g` again; PicoClaw will create the account, print the generated full email address, and stop so you can save that address in the config.
Available chatmail servers:
%s

What it means

The Delta Chat channel was constructed with an empty channel_list.deltachat.settings.email, which parseDeltaChatEmailSetting rejects. The error text embeds the next steps: pick a chatmail server from the built-in relay list, set email to `@server` (PicoClaw then creates the account on next `picoclaw g`) or set a full address. This fires at channel construction time (NewDeltaChatChannel), before anything starts.

Source

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

	*channels.BaseChannel
	bc     *config.Channel
	config *config.DeltaChatSettings

	serverPath string
	dataDir    string

	rpc       *rpcClient
	accountID int64
	selfAddr  string

	ctx    context.Context
	cancel context.CancelFunc
}

func parseDeltaChatEmailSetting(value string) (string, bool, error) {
	email := strings.TrimSpace(value)
	if email == "" {
		return "", false, fmt.Errorf(
			"deltachat: email is required.\nNext step: choose one of the chatmail servers below and set channel_list.deltachat.settings.email to %q, or use the same @server form with another chatmail relay. Run `picoclaw g` again; PicoClaw will create the account, print the generated full email address, and stop so you can save that address in the config.\nAvailable chatmail servers:\n%s",
			"@"+defaultChatmailRelays[0].Domain,
			formatChatmailRelayList(),
		)
	}
	if !strings.HasPrefix(email, "@") {
		return email, false, nil
	}
	domain := strings.ToLower(strings.TrimSpace(strings.TrimPrefix(email, "@")))
	if domain == "" {
		return "", false, fmt.Errorf("deltachat: email %q is missing a chatmail server. Use %q or one of:\n%s",
			email, "@"+defaultChatmailRelays[0].Domain, formatChatmailRelayList())
	}
	if strings.Contains(domain, "@") || strings.ContainsAny(domain, "/\\ \t\r\n") {
		return "", false, fmt.Errorf("deltachat: invalid chatmail server marker %q; use settings.email like %q",
			email, "@"+defaultChatmailRelays[0].Domain)
	}
	return domain, true, nil

View on GitHub (pinned to 49183d7e8d)

Solutions

  1. Set channel_list.deltachat.settings.email to `@<chatmail-server>` (e.g. @nine.testrun.org) and run `picoclaw g`; PicoClaw creates the account, prints the full generated address, and stops so you can save it back into the config.
  2. Alternatively set email to a full existing address if you already have a chatmail/Delta Chat account.
  3. Check YAML indentation: settings must be a map under the deltachat channel with email as a key, not a sibling string.
  4. Re-run the generator and follow the printed relay list in the error message.

Example fix

# before
channel_list:
  deltachat:
    settings: {}

# after
channel_list:
  deltachat:
    settings:
      email: "@nine.testrun.org"
Defensive patterns

Strategy: validation

Validate before calling

// Mirror the library check before constructing the channel
if strings.TrimSpace(cfg.Email) == "" {
    return fmt.Errorf("deltachat settings.email is empty; set it to '@server' or a full address")
}

Type guard

func hasDeltaChatEmail(cfg *config.DeltaChatSettings) bool {
    return cfg != nil && strings.TrimSpace(cfg.Email) != ""
}

Try / catch

ch, err := deltachat.NewDeltaChatChannel(bc, cfg, bus)
if err != nil {
    if strings.Contains(err.Error(), "deltachat: email is required") {
        // follow the printed relay list, set settings.email, re-run picoclaw g
    }
    return err
}

Prevention

When it happens

Trigger: NewDeltaChatChannel (or `picoclaw g` / manager init) with config.ChannelDeltaChatSettings.Email unset, whitespace-only, or the deltachat block missing the settings.email key entirely.

Common situations: First-time setup where the user enabled the deltachat channel but skipped email; YAML indentation putting email at the wrong level so it never unmarshals; copying a sample config that comments out email; trimming the config down and accidentally removing the key.

Related errors


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