> For the complete documentation index, see [llms.txt](https://docs.enginsight.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.enginsight.com/docs/knowledge-base/english/configuration/how-do-i-configure-an-email-server-for-notifications-in-enginsight.md). Agents can also search and read this documentation through its [MCP server](https://docs.enginsight.com/docs/~gitbook/mcp).

# How do I configure an email server for notifications in Enginsight (legacy)?

{% hint style="info" %}
**Please note**: Configuring the email server via the Enginsight configuration file on the Application Server is a **legacy feature**. As of **release 4.9.1**, the email server can be configured directly in the Enginsight platform under **Settings** → [Email Server](https://docs.enginsight.com/docs/manual/english/administration/settings/email-server).
{% endhint %}

***

To receive email notifications, for example when an alert is triggered in the Enginsight platform, you must configure your email server in the Enginsight configuration file. In the following, we will show you what steps you need to take.

***

## Configuring the Email Server

{% hint style="warning" %}
**Please note:** The following steps must be taken *on the Enginsight Application Server*. If you are using a [load-balanced setup](https://docs.enginsight.com/docs/manual/english/installation-and-configuration/installation-and-configuration/load-balanced-setup), you must also configure the email server on the virtual machine that hosts the [Enginsight Services](https://docs.enginsight.com/docs/manual/english/installation-and-configuration/installation-and-configuration/load-balanced-setup/server-for-the-enginsight-services).
{% endhint %}

{% stepper %}
{% step %}
Log in to the Enginsight Application Server if you have not already done so.

You can do this either directly through the console of your Application Server VM or remotely via SSH (Secure Shell) from a different machine.
{% endstep %}

{% step %}
Open the Enginsight configuration file using the following command:

```
sudo nano /opt/enginsight/enterprise/conf/services/config.json
```

{% endstep %}

{% step %}
Navigate to the `email` section and adjust it as follows:

<pre><code>"email": {
<strong>    "sender": "'&#x3C;CompanyName>' &#x3C;SenderEmailAddress>",
</strong><strong>    "host": "&#x3C;MailServerHostname>",
</strong><strong>    "port": "&#x3C;MailServerPort>",
</strong>    "sslTls": true,
<strong>    "user": "&#x3C;MailServerUsername>",
</strong><strong>    "pass": "&#x3C;MailServerPassword>",
</strong>    "maxConnections": 5,
    "rateDelta": 1000,
    "rateLimit": 5
  },
</code></pre>

{% hint style="info" %}
Remember to replace the placeholders in `<>` accordingly:

* `<CompanyName>`
* `<SenderEmailAddress>`
* `<MailServerHostname>`
* `<MailServerPort>`
* `<MailServerUsername>`
* `<MailServerPassword>`
  {% endhint %}

{% hint style="danger" %}
**Please note:** If you have configured an SPF (Sender Policy Framework) record in your DNS, specifying a sender address is mandatory.
{% endhint %}

{% hint style="warning" %}
**Please note**: In some cases, a different email server configuration might be required. Example configurations can be found in the section [Alternative Configurations](#alternative-configurations).
{% endhint %}
{% endstep %}

{% step %}
Save the changes to the configuration file (**Ctrl** + **o**) and confirm the save process. Close the file (**Ctrl** + **x**).
{% endstep %}

{% step %}
You must now run the Application Server setup script again to apply your changes.

Navigate to the Enginsight installation directory using the following command:

```
cd /opt/enginsight/enterprise
```

{% endstep %}

{% step %}
Run the setup script anew using the following command and confirm all prompts by pressing **Enter**:

```
sudo ./setup.sh
```

{% endstep %}
{% endstepper %}

### Alternative Configurations

In some cases, the email server requires a configuration that differs from the default settings. The following examples show configurations for a [Microsoft 365 email server](#example-configuration-for-a-microsoft-365-mail-server), an on-premises [Microsoft Exchange server](#example-configuration-for-an-on-premises-exchange-server), and an [email server without TLS](#example-configuration-for-a-mail-server-without-tls).

#### Example Configuration for a Microsoft 365 Email Server

{% hint style="info" %}
Remember to replace the placeholders in `<>` accordingly:

* `<CompanyName>`
* `<SenderEmailAddress>`
* `<MailServerUsername>`
* `<MailServerPassword>`
  {% endhint %}

<pre><code>"email":{
<strong>  "sender": "'&#x3C;CompanyName>' &#x3C;SenderEmailAddress>",
</strong>  "unqueued": true,
  "host": "smtp.office365.com",
  "requireTLS": false, 
  "ignoreTLS": false, 
  "rejectUnauthorized": false, 
  "secure": false, 
  "sslTls": false,
  "port": 587,
<strong>  "user": "&#x3C;MailServerUsername>",
</strong><strong>  "pass": "&#x3C;MailServerPassword>",
</strong>  "maxConnections": 5,
  "rateDelta": 1000,
  "rateLimit": 5,
  "service": "Outlook365"
}, 
</code></pre>

#### Example Configuration for an On-Premises Microsoft Exchange Server

{% hint style="info" %}
Remember to replace the placeholders in `<>` accordingly:

* `<CompanyName>`
* `<SenderEmailAddress>`
* `<MailServerHostname>`
* `<MailServerUsername>`
* `<MailServerPassword>`
  {% endhint %}

<pre><code>"email":{
<strong>  "sender": "'&#x3C;CompanyName>' &#x3C;SenderEmailAddress>",
</strong>  "unqueued": true,
<strong>  "host": "&#x3C;MailServerHostname>",
</strong>  "requireTLS": false, 
  "ignoreTLS": false, 
  "rejectUnauthorized": false, 
  "secure": false, 
  "sslTls": false,
  "port": 587,
<strong>  "user": "&#x3C;MailServerUsername>",
</strong><strong>  "pass": "&#x3C;MailServerPassword>",
</strong>  "maxConnections": 5,
  "rateDelta": 1000,
  "rateLimit": 5
}, 
</code></pre>

#### Example Configuration for an Email Server Without TLS

{% hint style="info" %}
Remember to replace the placeholders in `<>` accordingly:

* `<CompanyName>`
* `<SenderEmailAddress>`
* `<MailServerHostname>`
* `<MailServerUsername>`
* `<MailServerPassword>`
  {% endhint %}

<pre><code>"email":{
<strong>  "sender": "'&#x3C;CompanyName>' &#x3C;SenderEmailAddress>",
</strong>  "unqueued": true,
<strong>  "host": "&#x3C;MailServerHostname>",
</strong>  "requireTLS": false, 
  "ignoreTLS": true, 
  "rejectUnauthorized": false, 
  "secure": false, 
  "sslTls": false,
<strong>  "user": "&#x3C;MailServerUsername>",
</strong><strong>  "pass": "&#x3C;MailServerPassword>",
</strong>  "maxConnections": 5,
  "rateDelta": 1000,
  "rateLimit": 5
},
</code></pre>

***

## Testing the Email Server Configuration

After configuring the email server, you can check the configuration from the Application Server console.

Follow these steps:

{% stepper %}
{% step %}
Use the following command to obtain the ID of the Sentinel Docker container that is installed on the Application Server:

```
sudo docker ps --filter "name=sentinel" --format "{{.ID}}"
```

{% hint style="danger" %}
**Please note**: This step is **mandatory** since all container IDs are created anew when you run the setup script for the Application Server again!
{% endhint %}
{% endstep %}

{% step %}
Use the following command to send a test email and press **Enter** to confirm your input:

```
sudo docker exec <SentinelContainerID> ./sendTestMail --to <RecipientEmailAddress>
```

{% hint style="info" %}
Remember to replace `<SentinelContainerID>` and `<RecipientEmailAddress>` accordingly.
{% endhint %}
{% endstep %}

{% step %}
If the configuration is correct, the following message will be shown in the console:

<figure><img src="https://2451436285-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fj1tpIYVLbDaeg6W04yHz%2Fuploads%2FTq4o6FRgy7Y2FQufW9tv%2FEnginsight-Mailserverkonfiguration-erfolgreich.jpg?alt=media&amp;token=939c2321-7f41-437d-8643-75736d72e620" alt=""><figcaption></figcaption></figure>

You should also receive a test email at the specified recipient email address.
{% endstep %}
{% endstepper %}

***
