2026-09-19 15:52:14 +08:00
|
|
|
import { Mail } from "lucide-react";
|
|
|
|
|
|
2026-07-19 23:30:49 +08:00
|
|
|
import type { ChannelUiContribution } from "@/channel-plugins/types";
|
|
|
|
|
import {
|
|
|
|
|
type ChannelProviderPresetDefinition,
|
|
|
|
|
chatAppGuideUrl,
|
2026-10-13 13:56:28 +08:00
|
|
|
} from "@/channel-plugins/catalog";
|
2026-07-19 23:30:49 +08:00
|
|
|
|
|
|
|
|
const EMAIL_PROVIDER_PRESETS: ChannelProviderPresetDefinition[] = [
|
|
|
|
|
{
|
|
|
|
|
id: "gmail",
|
|
|
|
|
values: {
|
|
|
|
|
"channels.email.imapHost": "imap.gmail.com",
|
|
|
|
|
"channels.email.imapPort": "993",
|
|
|
|
|
"channels.email.smtpHost": "smtp.gmail.com",
|
|
|
|
|
"channels.email.smtpPort": "587",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "outlook",
|
|
|
|
|
values: {
|
|
|
|
|
"channels.email.imapHost": "outlook.office365.com",
|
|
|
|
|
"channels.email.imapPort": "993",
|
|
|
|
|
"channels.email.smtpHost": "smtp.office365.com",
|
|
|
|
|
"channels.email.smtpPort": "587",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
id: "icloud",
|
|
|
|
|
values: {
|
|
|
|
|
"channels.email.imapHost": "imap.mail.me.com",
|
|
|
|
|
"channels.email.imapPort": "993",
|
|
|
|
|
"channels.email.smtpHost": "smtp.mail.me.com",
|
|
|
|
|
"channels.email.smtpPort": "587",
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
presentation: {
|
2026-09-19 15:52:14 +08:00
|
|
|
icon: Mail,
|
2026-07-19 23:30:49 +08:00
|
|
|
displayName: "Email",
|
|
|
|
|
initials: "EM",
|
|
|
|
|
color: "#64748B",
|
|
|
|
|
setup: {
|
|
|
|
|
mode: "credentials",
|
|
|
|
|
docsUrl: chatAppGuideUrl("email"),
|
|
|
|
|
presets: EMAIL_PROVIDER_PRESETS,
|
|
|
|
|
fields: [
|
2026-09-11 15:22:14 +08:00
|
|
|
{ key: "channels.email.consentGranted", section: "account" },
|
|
|
|
|
{ key: "channels.email.imapHost", section: "receiving" },
|
|
|
|
|
{ key: "channels.email.imapUsername", section: "receiving" },
|
|
|
|
|
{ key: "channels.email.imapPassword", section: "receiving" },
|
|
|
|
|
{ key: "channels.email.imapPort", section: "receiving" },
|
|
|
|
|
{ key: "channels.email.smtpHost", section: "sending" },
|
|
|
|
|
{ key: "channels.email.smtpUsername", section: "sending" },
|
|
|
|
|
{ key: "channels.email.smtpPassword", section: "sending" },
|
|
|
|
|
{ key: "channels.email.smtpPort", section: "sending" },
|
|
|
|
|
{ key: "channels.email.fromAddress", section: "sending" },
|
|
|
|
|
{ key: "channels.email.pollIntervalSeconds", section: "behavior" },
|
|
|
|
|
{ key: "channels.email.allowFrom", section: "access" },
|
|
|
|
|
{ key: "channels.email.verifyDkim", section: "security" },
|
|
|
|
|
{ key: "channels.email.verifySpf", section: "security" },
|
2026-09-01 10:43:36 +08:00
|
|
|
{ key: "channels.email.trustedAuthservIds", section: "security" },
|
2026-07-19 23:30:49 +08:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
} satisfies ChannelUiContribution;
|