diff --git a/pkg/migrate/config.go b/pkg/migrate/config.go index 2237a1429..3b15e7ff0 100644 --- a/pkg/migrate/config.go +++ b/pkg/migrate/config.go @@ -32,6 +32,7 @@ var supportedChannels = map[string]bool{ "qq": true, "dingtalk": true, "maixcam": true, + "email": true, } func findOpenClawConfig(openclawHome string) (string, error) { @@ -203,6 +204,9 @@ func ConvertConfig(data map[string]any) (*config.Config, []string, error) { if v, ok := getFloat(cMap, "port"); ok { cfg.Channels.MaixCam.Port = int(v) } + case "email": + cfg.Channels.Email.Enabled = enabled + cfg.Channels.Email.AllowFrom = allowFrom } } } diff --git a/pkg/migrate/migrate_test.go b/pkg/migrate/migrate_test.go index ccc00f72c..f86486761 100644 --- a/pkg/migrate/migrate_test.go +++ b/pkg/migrate/migrate_test.go @@ -234,7 +234,7 @@ func TestConvertConfig(t *testing.T) { t.Run("unsupported channel warning", func(t *testing.T) { data := map[string]any{ "channels": map[string]any{ - "email": map[string]any{ + "unknown_channel": map[string]any{ "enabled": true, }, }, @@ -247,7 +247,7 @@ func TestConvertConfig(t *testing.T) { if len(warnings) != 1 { t.Fatalf("expected 1 warning, got %d", len(warnings)) } - if warnings[0] != "Channel 'email' not supported in PicoClaw, skipping" { + if warnings[0] != "Channel 'unknown_channel' not supported in PicoClaw, skipping" { t.Errorf("unexpected warning: %s", warnings[0]) } })