> For the complete documentation index, see [llms.txt](https://documentation.efalia.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentation.efalia.com/produit/acropolis/installation/parametrage-mail-office-365.md).

# Paramétrage mail Office 365

Cette procédure permet de paramétrer une adresse de messagerie office 365.

Documentation basée sur :

<https://support.microsoft.com/fr-fr/office/param%C3%A8tres-pop-imap-et-smtp-8361e398-8af4-4e97-b147-6c6c4ac95353>

et

[Accessing Office 365 with IMAP and OAuth2 • Codewrecks](https://www.codewrecks.com/post/security/accessing-office-365-imap-with-oauth2/)

Depuis Janvier 2023, Microsoft ne permet plus de faire de l'authentification basique pour l'accès aux services de messagerie Exchange 365.

C'est pour cela qu'il est nécessaire de configurer Azure Active Directory afin d'y accéder en passant par Microsoft Graph sans connexion interactive (condition requise pour ADC par exemple).

{% stepper %}
{% step %}
Accéder à l'administration Azure Active Directory depuis le portail Azure

[Accueil - Microsoft Azure](https://portal.azure.com/)

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-7aeb999f7cc161b75f10ea50e4c3b3e760ab20ee%2Finstall-mail-o365-01.webp?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-2f36aa102d4f638bbad2c4c5cba29f2624ea3944%2Finstall-mail-o365-02.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
A partir de là nous allons pouvoir créer l'application dédiée à la gestion des mails

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-893d5bef8283083171e4d0c56fa3be7822471bdf%2Finstall-mail-o365-03.webp?alt=media" alt=""><figcaption></figcaption></figure>

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-c32029145480812326ace86db4de6ed7591addc6%2Finstall-mail-o365-04.webp?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Une fois l'application créée, il est nécessaire de récupérer les informations suivantes pour les renseigner dans le paramétrage d'Acropolis.

* 1 : ID d'application
* 2 : ID du « tenant »

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-6f7222de5cb4507ffcdf14bb0db7e3181dc0a894%2Finstall-mail-o365-05.webp?alt=media" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Ensuite aller sur « 3 : Certificats et secrets » pour créer un nouveau secret

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-4e413b48ecb67f66fdcf29fbad7d5b1cf3ebb206%2Finstall-mail-o365-06.webp?alt=media" alt=""><figcaption></figcaption></figure>

Penser à copier la valeur du secret tout de suite au moment de la création car il n'est plus accessible ultérieurement. Ce secret sera nécessaire aussi au paramétrage d'Acropolis.

Il possède une date de validité donc il est obligatoire de le renouveler avant la fin de cette période pour une continuité de service.
{% endstep %}

{% step %}
Enfin aller dans « 4 : API autorisées » et ajouter les autorisations pour coller à l'écran suivant

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-568b1ca339b1466bb00546859db2f38260f40ab6%2Finstall-mail-o365-07.webp?alt=media" alt=""><figcaption></figcaption></figure>

Cliquer sur « Accorder un consentement d'administrateur pour XXXX » afin que le service soit autorisé à accéder au contenu des mails.
{% endstep %}
{% endstepper %}

## Paramétrage d’Acropolis

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-d048aa9d6c65b294fd359ced9abd51fd0c66ce13%2Finstall-mail-o365-08.webp?alt=media" alt=""><figcaption></figcaption></figure>

* Courrier entrant : IMAP (MailKit) port 993 et SSL
* Courrier sortant : SMTP (MailKit) port 587 et Authentification SMTP requise

{% hint style="warning" %}
Attention ne pas cocher SSL puisque STARTTLS.
{% endhint %}

L'option autoriser à accéder à ses comptes de messagerie permet à l'utilisateur d'accéder **aux paramètres** de messagerie.

<figure><img src="https://3557286639-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FcnnXLnfB61CBUw4H9Fho%2Fuploads%2Fgit-blob-470b90e8e79b3f2c5eca6693840e5183a366f19d%2Finstall-mail-o365-09.webp?alt=media" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://documentation.efalia.com/produit/acropolis/installation/parametrage-mail-office-365.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
