MCPcopy Index your code
hub / github.com/QLHazyCoder/FlowPilot / buildGeneratedAliasEmail

Function buildGeneratedAliasEmail

background.js:1947–1971  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

1945}
1946
1947function buildGeneratedAliasEmail(state) {
1948 const provider = state.mailProvider || '163';
1949 const emailPrefix = (state.emailPrefix || '').trim();
1950
1951 if (provider === GMAIL_PROVIDER) {
1952 if (!emailPrefix) {
1953 throw new Error('Gmail 原邮箱未设置,请先在侧边栏填写。');
1954 }
1955 const parsed = parseGmailBaseEmail(emailPrefix);
1956 if (!parsed) {
1957 throw new Error('Gmail 原邮箱格式不正确,请填写类似 name@gmail.com 的地址。');
1958 }
1959 return `${parsed.localPart}+${generateRandomWordAliasTag()}@${parsed.domain}`;
1960 }
1961
1962 if (!emailPrefix) {
1963 throw new Error('2925 邮箱前缀未设置,请先在侧边栏填写。');
1964 }
1965
1966 if (provider === '2925' && isGeneratedAliasProvider(state)) {
1967 return `${emailPrefix}${generateRandomSuffix(6)}@2925.com`;
1968 }
1969
1970 throw new Error(`未支持的别名邮箱类型:${provider}`);
1971}
1972
1973function getLuckmailSessionConfig(state = {}) {
1974 return {

Callers 1

Calls 4

isGeneratedAliasProviderFunction · 0.85
generateRandomSuffixFunction · 0.85
parseGmailBaseEmailFunction · 0.70

Tested by

no test coverage detected