---
title: "Configuration"
weight: 70
description: "Capmail module settings: mailboxes, behavior, leads, advanced options, labels, extraction templates and access rights."
source_hash: "a3a823c3"
---

# Configuration

The module configuration is found in **Tools > Capmail**, then click the gear icon, or access it via **Home > Setup > Modules > Capmail > Gear**. The administration page is organized in four main tabs and several secondary tabs.

## Main tabs

| Tab | Description | Dedicated page |
|-----|-------------|----------------|
| **Mailboxes** | IMAP/SMTP accounts, folders, sending address. Mandatory entry point. | [Mailboxes](/capmail/admin-mailboxes) |
| **Behavior** | General settings: menu, IMAP archiving, exclusions, HTML editor, default sending mailbox. | [Behavior](/capmail/admin-behavior) |
| **Leads and third parties** | Default values for creating third parties and projects, automatic reply, status colors. | [Leads and third parties](/capmail/admin-leads) |
| **Advanced** | Custom flags, extra fields, column order, maintenance tools. | [Advanced](/capmail/admin-advanced) |

## Secondary tabs

| Tab | Description | Dedicated page |
|-----|-------------|----------------|
| **Extraction templates** | Automatic form detection (Contact Form 7, Wix, etc.) and data extraction. | [Templates](/capmail/admin-templates) |
| **Labels** | Shared and personal Capmail labels to classify emails. | [Labels](/capmail/admin-tags) |
| **Email domains** | Servers and folders of the company domains: a user of these domains only has to enter their address and password. | [Mailboxes](/capmail/admin-mailboxes#domaines-de-messagerie-de-lentreprise) |
| **Mailbox access rights** | User x mailbox matrix (read/send). | [Permissions](/capmail/permissions) |
| **About** | Information about the module version. | -- |

![Overview of the Capmail administration](screenshots/administration-capmail.webp)

## First-time setup

As long as no mailbox is created, the main interface displays an onboarding page inviting the administrator to create the first mailbox. The standard workflow is:

1. Create a **mailbox** ("Mailboxes" tab, **New mailbox** button) and test the IMAP connection.
2. Configure the **SMTP** on the same card to be able to send replies (optional: otherwise the global Dolibarr SMTP is used).
3. Give **access rights** to the relevant users ("Mailbox access rights" tab).
4. Adjust the **general behavior** (sender exclusions, IMAP archiving, etc.) in the "Behavior" tab.
5. If you process web form emails, create **extraction templates** to pre-fill third party cards automatically.

## Personal mailbox

Each user can configure their own IMAP mailbox directly from the leads interface, by clicking the gear icon in the toolbar.

### Prerequisite

The administrator must first grant the "Use a personal mailbox" permission to the user concerned (see [Permissions](/capmail/permissions)).

### Adding your mailbox: the address is usually enough

At the top of the form, enter your **email address** then click **Detect servers**. Capmail fills in the IMAP and SMTP servers:

- if the address belongs to a **company domain** declared by the administrator, its servers and folders are used as they are;
- if it is a **known provider** (Gmail, Free, Orange, SFR, La Poste, OVHcloud, IONOS, Gandi, Infomaniak, Yahoo, iCloud, GMX...), including a company domain hosted by one of them, its servers are suggested;
- otherwise, Capmail queries the DNS records of the domain, then tries `imap.` and `mail.` followed by the domain, and keeps them only if the server answers.

In the first two cases, the server settings collapse: only the password remains to be entered. The **Show server settings** link expands them again. A message reports special cases: app password required (Gmail, Yahoo, iCloud), or provider refusing the password (Microsoft 365).

No information is sent to an external directory: only the DNS of the domain and, as a last resort, the presumed server are queried.

![Personal mailbox of a company domain: only the address and password are requested](screenshots/fonction-detection-serveurs.webp)

### Privacy

Emails fetched via a personal mailbox are **private by default**: only the mailbox owner can see them. When a private email is linked to a Dolibarr third party, the user has the option to **share it with the team**, which makes it visible to other users who have access to the third party.

### Connection settings

The personal mailbox configuration form contains the following fields:

| Parameter | Description |
|-----------|-------------|
| IMAP server | Address of the IMAP server (e.g. `imap.gmail.com`) |
| Port | Connection port (993 for SSL, 143 for STARTTLS) |
| Encryption | Security type: SSL, TLS or STARTTLS |
| Login | Username or email address of the account |
| Password | IMAP account password |
| Folders | Configuration of the IMAP folders (Inbox, Sent, Trash, Spam, Archives, Drafts) |

### SMTP configuration (optional)

It is possible to configure an SMTP server associated with the personal mailbox to send emails directly from that mailbox. If SMTP is not configured, replies use the global Dolibarr SMTP configuration.

### Private and Personal

Two close notions not to be confused:

- the **Private** badge only means that the email comes from a personal mailbox and is visible to its owner only. All the emails of a personal mailbox are private, work emails included;
- the **Personal** system label is applied by the owner of the mailbox, email by email, to what belongs to their private life. Only the owner can apply it, and only to an email of their own personal mailbox (see [Mark an email as personal](/capmail/action-marquer-personnel)).

It is the **Personal** label, not the **Private** badge, that decides what is deleted by the purge and after the employee leaves.

### Purging personal emails

At the bottom of the personal mailbox card (**My mailboxes** page), the **Purge personal mails** section deletes the emails of the mailbox tagged **Personal**, and only them. The other emails of the mailbox, whether shared with the team or not, are kept: they are company documents. An email tagged **Personal** is deleted even if it was shared.

The section shows two counters: the **emails tagged Personal**, which will be deleted, and the **other emails**, which will be kept. The confirmation asks you to type `PURGE`. Only the owner of the mailbox can run this purge, and it is irreversible.

When an administrator disables or deletes the owner's account, their personal mailboxes are disabled and the same deletion happens automatically once the delay has elapsed (30 days by default, adjustable in the [Behavior](/capmail/admin-behavior) tab). If the account is enabled again before the end of the delay, the deletion is cancelled; the mailboxes stay disabled until the administrator enables them again.

The GDPR does not require erasing the name of a departed employee from archived business exchanges. It asks to let them retrieve and then delete their personal messages, and to set a retention period: this is what the **Personal** label, this purge and the deletion delay make possible. This information does not constitute legal advice.

## Automatic IMAP folder creation

When a mailbox contains only the INBOX folder (frequent with newly created accounts), Capmail automatically detects this situation and offers to create the standard IMAP folders:

- **Sent**
- **Trash**
- **Junk**
- **Archives**
- **Drafts**

A dedicated button appears on the configuration page of the relevant mailbox. The folders are created directly on the IMAP server and immediately available in the interface.

## Scheduled task

Module activation automatically registers a scheduled task (cron job) that collects emails every 2 hours. You can adjust the frequency in **Home > Setup > Scheduled tasks** by editing the "Capmail" job. The **Refresh** button of the email list also launches an immediate collection on demand.

A second task, **Capmail - send scheduled emails**, sends every five minutes the emails that users have scheduled (see [Send an email later](/capmail/action-envoyer-plus-tard)). Like the collection, it only takes effect if the Dolibarr **Scheduled tasks** module is enabled and run regularly by the server.
