> For the complete documentation index, see [llms.txt](https://dexcore.gitbook.io/guide/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dexcore.gitbook.io/guide/dexcore-guide-fr/setup/installation/config-file.md).

# Config File: IMAP & Domains Setup

{% hint style="info" %}
**What is IMAP?** IMAP (Internet Message Access Protocol) is a way for programs to read emails from a mail server. DexCore uses IMAP to read OTP codes (one-time passwords) that Outlook sends to your recovery emails. Without IMAP, the bot cannot receive these codes and most functions will fail.
{% endhint %}

{% hint style="info" %}
**What is a domain?** A domain is the part after the `@` in an email address (like `gmail.com` or `yourdomain.org`). You buy your own domain so DexCore can create recovery email addresses on it.
{% endhint %}

📖 **Setup Guides:** [Gmail Setup](/guide/dexcore-guide-fr/setup/installation/config-file/gmail-setup.md) | [Buying Domains](/guide/dexcore-guide-fr/setup/installation/config-file/buying-domains.md) | [Domains Setup](/guide/dexcore-guide-fr/setup/installation/config-file/domains-setup.md) | [Custom IMAP](/guide/dexcore-guide-fr/setup/installation/config-file/custom-imap.md)

***

## Before You Start

{% hint style="warning" %}
Make sure you have:

1. A Gmail account (or other email with IMAP) — 👉 [Gmail Setup](/guide/dexcore-guide-fr/setup/installation/config-file/gmail-setup.md)
2. At least one purchased domain — 👉 [Buying Domains](/guide/dexcore-guide-fr/setup/installation/config-file/buying-domains.md)
3. Domain catch-all set up to forward to your Gmail — 👉 [Domains Setup](/guide/dexcore-guide-fr/setup/installation/config-file/domains-setup.md)
   {% endhint %}

***

## How to Edit the Config File

{% hint style="warning" %}
Use a plain text editor like **Notepad** (built into Windows) or [Notepad++](https://notepad-plus-plus.org/). Word processors (Word, Google Docs) add hidden formatting that breaks JSON files.
{% endhint %}

{% hint style="info" %}
**Quick JSON lesson:** The Config file uses **JSON format**. Here's what you need to know:

* Everything is wrapped in **curly braces** `{ }`
* Each setting is a **"name": "value"** pair
* Text values go in **double quotes** `" "`
* Numbers do NOT need quotes
* Each line ends with a **comma** `,` EXCEPT the last line before `}`
* **One missing comma or quote will break the entire file**
  {% endhint %}

***

## Config File Format

Add the following data to the Config file:

```json
{
  "email": "your email here",
  "password": "your password here",
  "domain": "your @domain here",
  "imapHost": "imap host here",
  "imapPort": porthere
}
```

### What Each Field Means

| Field        | What to Put Here                                         | Example                 |
| ------------ | -------------------------------------------------------- | ----------------------- |
| **email**    | Your Gmail address (or other IMAP email)                 | `"test@gmail.com"`      |
| **password** | Your **App Password** (NOT your regular email password!) | `"czbv ghdg myvc ydmu"` |
| **domain**   | Your purchased domain, starting with `@`                 | `"@domain.org"`         |
| **imapHost** | The IMAP server address for your email provider          | `"imap.gmail.com"`      |
| **imapPort** | The port number for IMAP (usually `993`)                 | `993` (no quotes!)      |

{% hint style="warning" %}
Gmail requires an **App Password** — your regular password won't work with IMAP. 👉 [How to create one](/guide/dexcore-guide-fr/setup/installation/config-file/gmail-setup.md)
{% endhint %}

***

## Example: Configured IMAP (Gmail)

```json
{
  "email": "test@gmail.com",
  "password": "czbv ghdg myvc ydmu",
  "domain": "@domain.org",
  "imapHost": "imap.gmail.com",
  "imapPort": 993
}
```

{% hint style="success" %}
Notice: `imapPort` has the number `993` with **no quotes** around it. This is correct — ports are numbers, not text.
{% endhint %}

***

## Multiple IMAP Accounts

If you have multiple domains connected to different email accounts, add them all as an **array** (a list inside square brackets `[ ]`). The bot will use all of them when generating recovery emails:

```json
"IMAP": [
  {
    "email": "gmail1@gmail.com",
    "password": "aaaa bbbb cccc dddd",
    "domain": "@domain1.org",
    "imapHost": "imap.gmail.com",
    "imapPort": 993
  },
  {
    "email": "gmail2@gmail.com",
    "password": "eeee ffff gggg hhhh",
    "domain": "@domain2.net",
    "imapHost": "imap.gmail.com",
    "imapPort": 993
  }
]
```

{% hint style="warning" %}
When using multiple IMAP accounts, make sure each entry is separated by a **comma** between the `}` and `{`. The last entry should NOT have a comma after its closing `}`.
{% endhint %}

***

## Common Issues

{% hint style="warning" %}
If the bot can't read your Config file, check for these:

* Regular Gmail password used instead of App Password
* File edited in Word/Google Docs (hidden formatting)
* Missing quotes around text: `"email": test@gmail.com` — needs `"test@gmail.com"`
* Quotes around the port number: `"imapPort": "993"` — should be `993` without quotes
* Missing comma between lines, or extra comma after the last entry
* Missing `@` before the domain name
  {% endhint %}
