Feat: add IMAP data source integration with configuration and sync capabilities (#12316)

### What problem does this PR solve?
issue:
#12217 [#12313](https://github.com/infiniflow/ragflow/issues/12313)
change:
add IMAP data source integration with configuration and sync
capabilities

### Type of change

- [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
buua436
2025-12-30 17:09:13 +08:00
committed by GitHub
parent 109e782493
commit bffdb5fb11
11 changed files with 906 additions and 16 deletions

View File

@ -27,6 +27,7 @@ export enum DataSourceKey {
AIRTABLE = 'airtable',
GITLAB = 'gitlab',
ASANA = 'asana',
IMAP = 'imap',
GITHUB = 'github',
// SHAREPOINT = 'sharepoint',
// SLACK = 'slack',
@ -127,6 +128,11 @@ export const generateDataSourceInfo = (t: TFunction) => {
description: t(`setting.${DataSourceKey.GITHUB}Description`),
icon: <SvgIcon name={'data-source/github'} width={38} />,
},
[DataSourceKey.IMAP]: {
name: 'IMAP',
description: t(`setting.${DataSourceKey.IMAP}Description`),
icon: <SvgIcon name={'data-source/imap'} width={38} />,
},
};
};
@ -654,7 +660,7 @@ export const DataSourceFormFields = {
{
label: 'Access Token',
name: 'config.credentials.airtable_access_token',
type: FormFieldType.Text,
type: FormFieldType.Password,
required: true,
},
{
@ -722,7 +728,7 @@ export const DataSourceFormFields = {
{
label: 'API Token',
name: 'config.credentials.asana_api_token_secret',
type: FormFieldType.Text,
type: FormFieldType.Password,
required: true,
},
{
@ -778,6 +784,44 @@ export const DataSourceFormFields = {
defaultValue: false,
},
],
[DataSourceKey.IMAP]: [
{
label: 'Username',
name: 'config.credentials.imap_username',
type: FormFieldType.Text,
required: true,
},
{
label: 'Password',
name: 'config.credentials.imap_password',
type: FormFieldType.Password,
required: true,
},
{
label: 'Host',
name: 'config.imap_host',
type: FormFieldType.Text,
required: true,
},
{
label: 'Port',
name: 'config.imap_port',
type: FormFieldType.Number,
required: true,
},
{
label: 'Mailboxes',
name: 'config.imap_mailbox',
type: FormFieldType.Tag,
required: false,
},
{
label: 'Poll Range',
name: 'config.poll_range',
type: FormFieldType.Number,
required: false,
},
],
};
export const DataSourceFormDefaultValues = {
@ -1017,4 +1061,19 @@ export const DataSourceFormDefaultValues = {
},
},
},
[DataSourceKey.IMAP]: {
name: '',
source: DataSourceKey.IMAP,
config: {
name: '',
imap_host: '',
imap_port: 993,
imap_mailbox: [],
poll_range: 30,
credentials: {
imap_username: '',
imap_password: '',
},
},
},
};