

This is version 2.18 of the AWS Elemental Server documentation. This is the latest version. For prior versions, see the *Previous Versions* section of [AWS Elemental Conductor File and AWS Elemental Server Documentation](https://docs.aws.amazon.com/elemental-server/).

# Email Notifications
<a name="notification-email"></a>

You can configure AWS Elemental Server to email you notifications when alerts occur. 

AWS Elemental Server uses open relay to send email notifications. Before subscribing to notifications, make sure that your network allows receipt of open relay email. If your network doesn't allow open relay messages, you must also configure a Sendmail relay server with another mail server.

**Important**  
If you subscribe to email notifications in a network that doesn't allow open relay messages and you do not relay the messages, the generated messages will collect on the AWS Elemental Server system hard drive, eventually filling the partition and causing disk alert errors.

**To set up email notifications**

1. On the AWS Elemental Server web interface, subscribe to all or some alerts using the steps described here:  
**Subscribe to all alerts**  

   1. On the AWS Elemental Server web interface, go to the **Settings** page and ensure that you're on the **General** tab.

   1. Complete the **Global Alert Notification** fields as described in the following table and choose **Update**.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-server/latest/configguide/notification-email.html)  
**Subscribe to individual alerts**  

   1. On the AWS Elemental Server web interface, hover over **Stats** page and choose **Alerts**.

   1. On the **Alerts** page, choose **Configure Alerts**.

   1. In the list of alerts, locate the alert that you want to be notified on and choose it to expand it.

   1. Complete the fields as described in the following table and choose **Update**.    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/elemental-server/latest/configguide/notification-email.html)

   1. Locate, expand, and complete the fields for each alert that you want to be notified on.

1. If your network doesn't allow open relay messages, configure the sendmail server to relay the messages. For steps, see [Configure Sendmail Relay Server](notification-email-sendmail.md).

# Configure Sendmail Relay Server
<a name="notification-email-sendmail"></a>

Use this procedure to set up a Sendmail relay server if your network doesn't accept open relay messages.

## Step A: Gather the mail server information
<a name="notification-email-sendmail-ready"></a>

To configure AWS Elemental Server to relay the notification emails through a mail server, you need the following information:
+ The hostname of the mail server
+ If your network doesn't have DNS configured, the IP address of the mail server

## Step B: Install the Sendmail configuration tool
<a name="notification-email-sendmail-tool"></a>

**To install the configuration tool**

1. Install the `sendmail.cf` configuration tool by typing the following at the command line.

   ```
   sudo yum install sendmail-cf
   ```

1. When you receive a caution message asking you to confirm that you want to run the command, enter **yes**.

1. When you receive the following prompt, enter **y**.

   ```
   Is this ok [y/N]:
   ```

1. When you receive the following message, move on to the next step.

   ```
   Complete!
   ```

## Step C: Edit the `sendmail.mc` file
<a name="notification-email-sendmail-edit"></a>

**To edit the file**

1. With a text editor, open the `sendmail.mc` file. If you use Nano, which comes installed on all AWS Elemental systems, type the following at the command line to open the file in Nano.

   ```
   sudo nano /etc/mail/sendmail.mc
   ```

1. Locate the line that defines `SMART_HOST`. It's generally just past halfway down the page and should look like this.

   ```
   dnl define(`SMART_HOST', `smtp.your.provider')dnl
   ```

1. Uncomment this line by deleting the `dnl` at the beginning and end of the line.

1. Change the following text to the hostname of the mail server that is performing the relay.

   ```
   smtp.your.provider
   ```

1. Save and exit the file. For Nano, press Ctrl\$1O to save and Ctrl\$1X to exit.

## Step D: Check the `hosts` file
<a name="notification-email-sendmail-hosts"></a>

If your network isn't configured with DNS, add a static entry to the `hosts` file on AWS Elemental Server.

**To add an entry to the `hosts` file**

1. With a text editor, open the `/etc/hosts` file. If you use nano, type the following at the command line.

   ```
   sudo nano /etc/mail/hosts
   ```

1. Add a line to the end of the file that has the IP address of the relay server, a space, and the hostname of the relay server. The following shows an example.

   ```
   10.24.34.2 ExampleMailHostname
   ```

1. Save and exit the file. For nano, press Ctrl\$1O to save and Ctrl\$1X to exit.

## Step E: Apply the changes
<a name="notification-email-sendmail-apply"></a>

1. To apply changes, enter the following command.

   ```
   sudo make -C /etc/mail
   ```

   The system responds as follows.

   ```
   make: Entering directory `/etc/mail'
   make: Leaving directory `/etc/mail'
   ```

1. Restart Sendmail by typing the following.

   ```
   sudo service sendmail restart
   ```

## Step F: Test the new configuration
<a name="notification-email-sendmail-test"></a>

Test the relay by having the system email you an alert notification.

**To test the configuration**

1. If you haven't already, subscribe to global alert notifications as described in [Email Notifications](notification-email.md). Provide an email address that you have easy access to.

1. Generate a fake alert. A simple way to do so is to create and start a channel with a simple UDP input and output with a fake input address, such as **udp://1.1.1.1:1111**.

1. Check your email for the notifications message.

1. If necessary, return the global alert notifications to your desired settings.